Crossing the Desert
All submissions for this problem are available.
Its war time in Byte Land. The emperor of Bit Land has declared a war on Byte Land. Its General Timon who will be heading the operations for Byte Land. Now General Timon wants to increase his alliances who live across The Great Desert of Bits N Bytes. The only mode of communication is camels.
Timon wants to inform his alliances about the war to seek their help by sending messengers to them .Now Byte Land has infinite number of camels and messengers. However the problem is that 1 camel needs 1 unit of food for 1 unit of distance that it covers and 1 camel can carry at most 1 unit of food. So 1 camel can at most cover 1 unit distance . But again the camel also needs food for returning to Byte Land which means 1 camel carrying 1 unit of food can travel 1/2 unit distance so that it can return to Byte Land. There are no food supply in the desert.
Timon doesn't want to lose his camels or messengers . So he has to send more than 1 camel together so that after covering some distance some part of the food (fractional) carried by a camel can be given to the other camels so that others camels can cover greater distance and as well as the camel can return to Byte Land on the remaining amount of food. Can you help him out in sending messengers to his alliances ? Help him decide how many camels should he set out together so that one messenger reaches the destination .Once the camel reaches the destination your task is over. You need not worry about the return journey from the alliance destination.
The first line contains an integer T the number of test cases .Each test case has a decimal X (units distance) the distance to covered in the desert to reach the destination.
Output in each line 1 integer Y the number of camels that Timon should set out together such that at least 1 messenger reaches the alliances and none of the camels starve in the desert.Messenger should either reach Byte Land or the alliances.
1<= T <= 10^5
1<= X <= 10
|Time Limit:||0.112676 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.