Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text.RegularExpressions;
  5.  
  6. namespace Rextester
  7. {
  8. public class Program
  9. {
  10. public static void Main(string[] args)
  11. {
  12.  
  13. string[] tokens = Console.ReadLine().Split();
  14. ulong a = ulong.Parse(tokens[0]);
  15. ulong b = ulong.Parse(tokens[1]);
  16. ulong c = ulong.Parse(tokens[2]);
  17.  
  18. ulong count = 0;
  19. for (ulong i = 0; i < b; i++)
  20. {
  21. if (c == 1)
  22. {
  23. Console.WriteLine("-1");
  24. break;
  25. }
  26. if (a < b)
  27. {
  28. a *= c;
  29. count++;
  30. }
  31. if (a >= b)
  32. {
  33. Console.WriteLine(count);
  34. break;
  35. }
  36.  
  37. }
  38. }
  39. }
  40. }
Add Comment
Please, Sign In to add comment