There are legends of vampires (vampire). Vampire fights are vampires and enemies taking turns attacking each other. Vampire and enemy both have blood and attack two indicators, who first without blood, who will lose. Every time a vampire attacks an enemy, the amount of blood the enemy loses is equal to the vampire's attack. Every time an opponent attacks a vampire, the amount of blood the vampire loses is equal to the enemy's attack. The vampire fight, always by the enemy first attack, and then turn to vampire attacks, in turn. This question wants to know the vampire wins and loses in every battle.
Only 1 lines, consisting of 4 integers. First enter the vampire's initial amount of blood and attack, then enter the enemy's initial blood volume and attack.
If the vampire wins, the output is win; if the vampire loses, the output lose.
90 10 90 37
Lose
#include "stdio.h"
int main ()
{
int a,a1,b,b1;
scanf ("%d%d%d%d", &A,&A1,&B,&B1);
if (B/A1>A/B1)
printf ("lose\n");
else if (B/A1<A/B1)
{
if ((B%A1) && (a%b1==0))
printf ("lose\n");
else if ((b%a1==0) && (A%B1))
printf ("win\n");
Else
printf ("win\n");
}
else if (B/A1==A/B1)
{
if ((B%A1) && (a%b1==0))
printf ("lose\n");
else if ((b%a1==0) && (A%B1))
printf ("win\n");
Else
printf ("lose\n");
}
return 0;
}
1007 The Vampire fight