Question Description |
Two springtails are fighting the Marines. Initially, the Marines found Springtails (two springtails side-by springtails) at a certain distance from him and started attacking (only one). When the springtails is 0 o'clock from the Marines, the attack is also launched. Suppose springtails a time unit to walk one meter, or every attack once. Marines attack once per unit of time. The last question was whether the Marines won or the Springtails won. VS |
Input |
Five integers, n (n <=), K (5 <= K <= 8), L (5 <= L <= 8), M (1 <= m <=), X (1 <= x <= 45). These numbers mean that the Marines found the enemy's distance, springtails attack damage, Marines ' attack, each springtails initial blood volume, and the last number was the first blood of the Marines. |
Output |
Output Marine win! or zergling win! Marines win when the output marine win! Springtails win-time output zergling win! |
Input example |
11 6 5) 45 35 |
Output example |
Zergling win! |
Other Notes |
Note that there is finally a line change! |
C + + programs:
#include <iostream>using namespacestd;intMain () {intN; intK; intm; intl; intx; CIN>> n >> k >> l >> m >>x; intMarine =x; intZERG1 =m; intZERG2 =m; intDistance =N; while(Marine >0&& (Zerg1 >0|| Zerg2 >0)) { if(Distance && zerg1 >0) {Distance--; Zerg1-=l; } Else if(Distance && zerg1 <=0&& zerg2 >0) {Distance--; Zerg2-=l; }Else if(Zerg1 >0) {Zerg1-=l; Marine-= k *2; } Else{zerg2-=l; Marine-=K; } } if(Marine >0) cout <<"Marine win!"<<Endl; Elsecout <<"zergling win!"<<Endl; return 0;}
StarCraft II Battle problem