Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ConsoleApp1
- {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- public class Program
- {
- public static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int m = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- int counter = 0;
- int originN = n;
- while (n >= m)
- {
- n -= m;
- counter++;
- if (n == originN * 0.5 && y != 0)
- {
- n /= y;
- }
- }
- Console.WriteLine(n);
- Console.WriteLine(counter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement