Advertisement
bullit3189

Poke Mon

Jan 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. public class Program
  5. {
  6. public static void Main()
  7. {
  8. int N = int.Parse(Console.ReadLine());
  9. int originalN = N;
  10. int M = int.Parse(Console.ReadLine());
  11. int Y = int.Parse(Console.ReadLine());
  12.  
  13. int counter =0;
  14.  
  15. while (N>=M)
  16. {
  17. N-=M;
  18. counter ++;
  19.  
  20. if (N == 0.5*originalN && N>0 && Y!=0)
  21. {
  22. N /=Y;
  23. }
  24. }
  25. Console.WriteLine(N);
  26. Console.WriteLine(counter);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement