NR2  Bhagat The Bit Man
Bhagat is student of CSE at ISM Dhanbad. In midsemsester exam somehow he was able to score full marks in Boolean algebra. So his profs doubt how can he score full marks. So profs decided to check his ability. They gave Bhagat a list student’s admission number and ask him to find total kaptiness (K) of list.
Kaptiness is defined as or operation on every dukkerness(d_{i}) value. Dukkerness value is xor operation on every pair of number in list.As we all know Bhagat is not good in Boolean algebra. Can you help him to prove his profs that he can score full out of full in boolean algebra.
Example:
If list contain three number 10, 15 & 17.Then there will be total 3 pairs.
d_{1} = 10 ^ 15 = 5;
d_{2} = 10 ^ 17 = 27;
d_{3} = 17 ^ 15 = 30;
k = d_{1}  d_{2}  d_{3 ;}
K = 31;
Input
First line of input contain N (2 <= N <= 10^{6}). N is total number of admission number(a_{i}) in list.
Then following N line will contain admission number. (0 <= a_{i }<=10^{18})
Output
Output only one line containing K.
Example
Input: 3 10 15 17 Output: 31
NOTE: Large input data.
test cases have been updated and all solutions are rejudged.
hide comments
the_pythor:
20200515 10:04:42
If you are using left shift then use 1LL<<j instead of 1<<j as the value will cross the integer range. It costed me 3 WA 

samanwaya:
20170402 10:10:10
Worth solving learnt a lot!!!


dwij28:
20160407 18:57:06
Nice and simple .. :) 

kejriwal:
20160105 18:30:23
comments are spoilers :P ! 

Siddharth Singh:
20151225 09:41:32
Learnt Something New , thanks To K MAPS 

MAYANK NARULA:
20151017 12:41:45
It's easy if u didn't neglect KMaps in HIGH SCHOOL 

Shivam Singh:
20150821 05:36:18
try this one to have fun with some Boolean Algebra


arpit:
20150624 20:57:12
nice problem...


Baymax:
20150526 03:14:43
use scanf/printf instead of cin/cout ... 

:.Mohib.::
20150214 15:18:31
Realy enjoyed....nice problem.... 
Added by:  NISHANT RAJ 
Date:  20140311 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  own 