All submissions for this problem are available.
It’s 1942. Wehrmacht is raining hell on the Royal British Armed Forces. Their only hope of salvation lies in supplies being sent from U.S.. Being cognizant of the gravity of the situation, Nazi Germany has managed to put up obstacles in the Atlantic. The time is running out. British Armed Forces need their supplies ASAP!
The Supreme Command has sanctioned 16 convoys with different capacity. Abwehr has information on catalogue of transfer ordnance, which means some convoys are at more risk than others plying same quantity, due to value of materials being transferred on the war effort. Aware of the counter intelligence failure, U.S. Navy has identified risk associated with driving the convoys through the Atlantic highways:
Convoy Table :
Large=100, Medium=50, Less=25, Negligible=10.
Very Important=1000, Important=500, Dispensable=250, Worthless=50
Re-deploying a convoy means bringing back the convoy from G.B to the U.S. , which involves 5 times the risk moving the convoy from U.S. to G.B.. Thus, redeployment means a total risk of 6 times the risk given in the chart.
It being war time, U.S. Navy wouldn’t deploy convoys beyond a certain risk tolerance. You need to help find them maximum quantity and maximum value (for a given risk tolerance, both may have different deployments) that can be shipped out.
The first line of input takes the number of test cases. Next n number of lines take risk tolerances (n being number of test cases).
Next 2n lines should contain Maximum quantity and Maximum value for each value of risk tolerances, i.e.
Maximum Quantity 1
Maximum Value 1
Maximum Quantity 2
Maximum Value 2
ExampleInput: 3 10 40 50 Output : 10 50 25 300 35 500
The first line has value 3 which tells the program number of test cases. In this case we are taking three inputs 10, 40, 50 as the value for risk tolerances. The third output line gives maximum quantity that can be shipped out when risk tolerance is 40 i.e 25 (when convoy 12 is deployed) and fourth output line gives maximum value that can be shipped out when risk tolerance is 40 i.e 300 (when convoy 15 and 16 is deployed)
|Time Limit:||1 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, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.