Confusion

5

1 votes
Problem

Appu is bit confused in competetive programming as which topics he have to study to maximise his programming knowledge. As there are N subjects and ith subject has value ai. His knowledge is equal to bitwise '&' of the values of subjects he choose to study .So he has to choose a subsequence from it and find the bitwise '&' of all the subjects he want to study to maximise his knowledge .

Input format

  • The first line contains an integer N denoting the number of subjects.
  • The second line contains an array of N integers denoting the value of ith subject .

Output format

        Print two space saperated integers the maximum knowledge and the maximum optimal subsequence size.

Constraints
 1N105
 1ai1018

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?