Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Poke Mon
- // Programming Fundamentals Exam - 09 July 2017 Part 1
- // https://judge.softuni.bg/Contests/Practice/Index/691#0
- // 100/100
- // Memory: 7.69 MB
- // Time: 0.015 s
- using System;
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine()),
- m = int.Parse(Console.ReadLine()),
- y = int.Parse(Console.ReadLine());
- int remainder = n,
- targets = 0;
- while (remainder >= m)
- {
- remainder -= m;
- targets++;
- if (2 * remainder == n && y != 0)
- reminder /= y;
- }
- Console.WriteLine($"{remainder}\n{targets}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment