ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1484. Film Rating

Помогите найти ошибку
Posted by Molchun 4 Oct 2019 13:13
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;

namespace _1484Kino
{
    class Program
    {
        static void Main(string[] args)
        {
            var userInput = Console.ReadLine().Split();
            var x = double.Parse(userInput[0],CultureInfo.InvariantCulture);
            var y = double.Parse(userInput[1], CultureInfo.InvariantCulture);
            var n = int.Parse(userInput[2], CultureInfo.InvariantCulture);
            int count = 0;
            if (y > 0.9 && x<=10.0)
            {
                while (Math.Round(x, 1 )> 1)
                {
                    x = ((x * n + 1) / (n + 1));
                    n += 1;
                    count++;
                }
                Console.WriteLine(count);
            }
            else
                Console.WriteLine("Impossible");

        }
    }
}