Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- // distance between targets reduces poke power
- // N - poke power
- // M - distance between targets
- // Y - exhaustion
- // M - N (succesful targeting - count it) until N < M
- // if N becomes 0.5 of itself -> divide N/Y (if possible / int division)
- //if not possible -> continue
- // when N < M -> print remains of N and count of targets
- // percentage calculating precise at maximum
- int n = int.Parse(Console.ReadLine());
- int m = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- int count = 0;
- decimal isN = (decimal)n * (50.0m / 100.0m);
- while (n >= m)
- {
- n -= m;
- if (n == isN)
- {
- n /= y;
- }
- else
- {
- continue;
- }
- count++;
- }
- Console.WriteLine(n);
- Console.WriteLine(count);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement