DIEHARD - DIE HARD
The game is simple. You initially have ‘H’ amount of health and ‘A’ amount of armor. At any instant you can live in any of the three places - fire, water and air. After every unit time, you have to change your place of living. For example if you are currently living at fire, you can either step into water or air.
If you step into air, your health increases by 3 and your armor increases by 2
If you step into water, your health decreases by 5 and your armor decreases by 10
If you step into fire, your health decreases by 20 and your armor increases by 5
If your health or armor becomes <=0, you will die instantly
Find the maximum time you can survive.
The first line consists of an integer t, the number of test cases. For each test case there will be two positive integers representing the initial health H and initial armor A.
For each test case find the maximum time you can survive.
Note: You can choose any of the 3 places during your first move.
1 <= t <= 10
1 <= H, A <= 1000
3 2 10 4 4 20 8
1 1 5
The tag for this problem is a TRAP.
yeah accepted in one go with 0.00 :)
First [spoiler] in one go :)Last edit: 2015-10-12 14:18:31
Accepted in one go
[spoiler removed]Last edit: 2015-09-16 23:29:07
what is [spoilers removed] !!!
So funny to read the comments! :P
For those who are trying [spoilers removed]Last edit: 2015-08-10 20:59:54
How to solve it using [spoilers removed]? I used [spoilers removed] bcs the constraints are feasible. But I really want to learn [spoilers removed].Last edit: 2015-08-10 21:00:43