Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int N = int.Parse(Console.ReadLine());
- int originalN = N;
- int M = int.Parse(Console.ReadLine());
- int Y = int.Parse(Console.ReadLine());
- int counter =0;
- while (N>=M)
- {
- N-=M;
- counter ++;
- if (N == 0.5*originalN && N>0 && Y!=0)
- {
- N /=Y;
- }
- }
- Console.WriteLine(N);
- Console.WriteLine(counter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement