Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Diagnostics.CodeAnalysis;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Threading;
- using System.Xml;
- namespace ConsoleApp1
- {
- class Exam
- {
- static void Main(string[] args)
- {
- int power = int.Parse(Console.ReadLine()); //N
- int distance = int.Parse(Console.ReadLine()); //M
- int exhaustion = int.Parse(Console.ReadLine()); //Y
- int original = power;
- int count = 0;
- while (power >= distance)
- {
- power -= distance;
- count++;
- if (power == original / 2.0)
- {
- if (exhaustion > 0)
- {
- power /= exhaustion;
- }
- }
- }
- Console.WriteLine(power);
- Console.WriteLine(count);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement