kolioi

LOL

Jul 10th, 2017
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. // Poke Mon
  2. // Programming Fundamentals Exam - 09 July 2017 Part 1
  3. // https://judge.softuni.bg/Contests/Practice/Index/691#0
  4. // 100/100
  5. // Memory: 7.69 MB
  6. // Time: 0.015 s
  7.  
  8. using System;
  9.  
  10. class Program
  11. {
  12.     static void Main()
  13.     {
  14.         int n = int.Parse(Console.ReadLine()),
  15.             m = int.Parse(Console.ReadLine()),
  16.             y = int.Parse(Console.ReadLine());
  17.  
  18.         int remainder = n,
  19.             targets = 0;
  20.  
  21.         while (remainder >= m)
  22.         {
  23.             remainder -= m;
  24.             targets++;
  25.             if (2 * remainder == n && y != 0)
  26.                 reminder /= y;
  27.         }
  28.  
  29.         Console.WriteLine($"{remainder}\n{targets}");
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment