Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- namespace FilmRating
- {
- class Program
- {
- static int calculateTask(double currentScore, double needScore, double countScores)
- {
- if (currentScore <= needScore)
- return 0;
- if (currentScore < 10 && needScore > 1) { }
- currentScore += 0.049999999999999999999999999999;
- needScore += 0.049999999999999999999999999999;
- var sumScore = currentScore * countScores;
- var k = (sumScore - needScore * countScores) / (needScore - 1);
- return (int) Math.Round(k); //WA 8
- }
- static void Main()
- {
- var k = Console.ReadLine().Split();
- var x = double.Parse(k[0], CultureInfo.CurrentCulture);
- var y = double.Parse(k[1], CultureInfo.CurrentCulture);
- var n = Int32.Parse(k[2]);
- Console.WriteLine(calculateTask(x, y, n).ToString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement