11063 - B2-Sequence


Difficulty : easy

Solution Description :

Ad hoc problem

After taking all the numbers as input, store them in an array. 
1. if ar[0] < 1 it is not obviously a B2 Sequence(see the description again). 
2. Also ar[k] must be less than ar[k + 1] for it to be a B2 sequence. 
3. Also note that i <= j. So for the first sample input:
  4
  1 2 4 8
  The sums should be calculated as: 1 + 1, 1 + 2, 1 + 4, 1 + 8, 2 + 2, 2 + 4.........8 + 8