Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PokeMon
- {
- class Program
- {
- static void Main(string[] args)
- {
- int power = int.Parse(Console.ReadLine());
- int distance = int.Parse(Console.ReadLine());
- int exhaustionFactor = int.Parse(Console.ReadLine());
- int restPower = power;
- int targetsCount = 0;
- while (restPower >= distance)
- {
- restPower -= distance;
- targetsCount++;
- if (restPower == power * 0.5 && exhaustionFactor != 0)
- {
- restPower /= exhaustionFactor;
- }
- }
- Console.WriteLine(restPower);
- Console.WriteLine(targetsCount);
- }
- }
- }
Add Comment
Please, Sign In to add comment