Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace Rextester
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- string[] tokens = Console.ReadLine().Split();
- ulong a = ulong.Parse(tokens[0]);
- ulong b = ulong.Parse(tokens[1]);
- ulong c = ulong.Parse(tokens[2]);
- ulong count = 0;
- for (ulong i = 0; i < b; i++)
- {
- if (c == 1)
- {
- Console.WriteLine("-1");
- break;
- }
- if (a < b)
- {
- a *= c;
- count++;
- }
- if (a >= b)
- {
- Console.WriteLine(count);
- break;
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment