One in Zillion

0

0 votes
Problem

The time is 1st January 20000014 Gazu is depressed with his life as he thinks there is nothing unique about him. One day he meets a travelling coder, Gazu tells him why he is depressed, to which coder replies “Everyone is one in a zillion my brother”. The coder explained it like this. Considering every man and woman marries at the age of 30 and have kids. Now if your age is A years, then imagine A years before two people got married to produce one Gazu, agreed? Good now A+30 years before (assuming when your parents married they were 30 years old) four people got married (your grand parents) to produce one Gazu. Coder continues if we go back in time like A+120 years, how many people got married just to produce one Gazu? Gazu quickly replies 32, to this coder smiles and leaves. Now Gazu asks you how many people will first get married to produce one Gazu if he go back A+N years in time. Make a program to calculate it.

INPUT First line will contain number of testcases t , next t lines will contains the value of A+N. 0<t<100 1<A+N<30,001

OUTPUT For each testcase print the number of people who will get married at that time. Assuming every one marries at the age of 30.

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

?