304 North Cardinal St.
Dorchester Center, MA 02124

# Weird Palindrome Making CodeChef Solution

## Weird Palindrome Making CodeChef Solution in C++17

``````#include <iostream>
using namespace std;

int main() {
long long t;
cin>>t;
while(t--){
long long n;
cin>>n;
long long c=0;
long long a[n];
for(int i=0; i<n; i++){
cin>>a[i];
if(a[i]%2!=0){
c++;
}
}
if(c<=1){
cout<<0<<endl;
}
else if(c==2){
cout<<1<<endl;
}
else{
cout<<c/2<<endl;
}

}
return 0;
}``````

## Weird Palindrome Making CodeChef Solution in C++14

``````//Weird Palidrome Making

#include <iostream>
#define ll long long
using namespace std;

void Solve(){
int N;
cin >> N;

int cnt = 0;

ll x;
for( int i = 0; i < N; i++){
cin >> x;
if((x & 1) == 1) cnt++;
}
cout << cnt / 2 << "\n";

}

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);

int T;
cin >> T;
while(T --){
Solve();
}
return 0;
}``````

## Weird Palindrome Making CodeChef Solution in PYTH 3

``````# cook your dish here
for _ in range(int(input())):
n = int(input())
ch = [int(x) for x in input().split()]
o = 0
for c in ch:
if c%2==1:  o+=1
print(int(o/2))
``````

## Weird Palindrome Making CodeChef Solution in C

``````#include <stdio.h>
#define ml long long int
int main()
{
ml t;
scanf("%lld",&t);
while(t--)
{
ml num,value,mvar=0;

scanf("%lld",&num);
for(ml i=0;i<num;i++)
{
scanf("%lld",&value);
if(value%2==1) mvar+=1;
}
if(mvar%2==1) mvar-=1;
printf("%lld\n",mvar/2);

}
return 0;
}``````

## Weird Palindrome Making CodeChef Solution in JAVA

``````import java.util.Scanner;
class WeirdPalindromeMaking
{
public static void main(String[] args)
{
int checking;
Scanner sc=new Scanner(System.in);
checking=sc.nextInt();
while(checking-->0)
{
int n,i,kcpd;
n=sc.nextInt();
int manam_manam_amalapuram[];
manam_manam_amalapuram=new int[n];
kcpd=0;
for(i=0;i<n;i++)
{
manam_manam_amalapuram[i]=sc.nextInt();
if(((manam_manam_amalapuram[i]>>1)<<1)!=manam_manam_amalapuram[i])
kcpd++;
}
if(((kcpd<<1)>>1)!=kcpd)
kcpd--;
System.out.println(kcpd>>1);
}
sc.close();
}
}``````

## Weird Palindrome Making CodeChef Solution in PYPY 3

``````for t in range(int(input())):
n=int(input())
a=input().split()
odd=0
for i in range(n):
a[i]=int(a[i])
if a[i]%2!=0:
odd=odd+1
print(odd//2)``````

## Weird Palindrome Making CodeChef Solution in PYTH

``````t = int(raw_input())
for i in range(t):
N = int(raw_input())
st = raw_input().split()
n = 0
for x in st:
n += int(x)%2
# endfor x
r = n/2
print r
# endfor i
``````

## Weird Palindrome Making CodeChef Solution in C#

``````using System;
using System.Linq;
public class Test
{
public static void Main()
{
int t= Convert.ToInt32(line);

while(t>0)
{
int[] a= line.Split(' ').Select(x=> Convert.ToInt32(x)).ToArray();
int count =0;
for(int i=0;i<a.Length;i++)
{
if(!(a[i]%2==0))
count++;
}

Console.WriteLine(count==0?0:count/2);

t--;

}
}
}``````

## Weird Palindrome Making CodeChef Solution in NODEJS

``````
process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});

process.stdin.on('end', _ => {
inputString = inputString.trim().split('\n').map(string => {
return string.trim();
});

main();
});

return inputString[currentLine++];
}

const getMaxLessThanK = (A) => {
let c = 0;
for(let i = 0 ; i < A.length; i++) {
if(A[i] % 2 === 1) c++;
}
return c % 2 === 1 ? (c - 1) / 2 : c / 2;
}

function main() {

for (let i = 0; i < q; i++) {
console.log(getMaxLessThanK(arr));
}
}``````

## Weird Palindrome Making CodeChef Solution in GO

``````package main

import (
"bufio"
"bytes"
"fmt"
"os"
)

func main() {
var buf bytes.Buffer

for tc > 0 {
tc--
res := solve(A)
buf.WriteString(fmt.Sprintf("%d\n", res))
}

fmt.Printf(buf.String())
}

func readInt(bytes []byte, from int, val *int) int {
i := from
sign := 1
if bytes[i] == '-' {
sign = -1
i++
}
tmp := 0
for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
tmp = tmp*10 + int(bytes[i]-'0')
i++
}
*val = tmp * sign
return i
}

return
}

a, b = res[0], res[1]
return
}

a, b, c = res[0], res[1], res[2]
return
}

res := make([]int, n)
x := 0
for i := 0; i < n; i++ {
for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
x++
}
}
return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
i := from

var tmp uint64
for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
tmp = tmp*10 + uint64(bytes[i]-'0')
i++
}
*val = tmp

return i
}

func solve(A []int) int {
// only need to change odd numbers to some odd number, and leave the max odd
var cnt int
for _, a := range A {
if a%2 == 1 {
cnt++
}
}
return cnt / 2
}``````
##### Weird Palindrome Making CodeChef Solution Review:

In our experience, we suggest you solve this Weird Palindrome Making CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.

If you are stuck anywhere between any coding problem, just visit Queslers to get the Weird Palindrome Making CodeChef Solution.

Find on CodeChef

##### Conclusion:

I hope this Weird Palindrome Making CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Programming Language in a business context; there are no prerequisites.

Keep Learning!