Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Problem_1.Poke_Mon
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine()); //N
- int M = int.Parse(Console.ReadLine()); //M
- int Y = int.Parse(Console.ReadLine()); //Y
- bool isAccurateValue = true;
- if (Y == 0 || Y == 1)
- {
- isAccurateValue = false;
- }
- int originalValueDividedBy2 = 0;
- if (N % 2 == 0) //we need EXACTLY 50% of the original value
- {
- originalValueDividedBy2 = N / 2;
- }
- int targetsPoked = 0;
- while (N >= M)
- {
- if (N == originalValueDividedBy2 && isAccurateValue)
- {
- N /= Y;
- continue;
- }
- N -= M;
- targetsPoked++;
- }
- Console.WriteLine(N);
- Console.WriteLine(targetsPoked);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement