Advertisement
pevel

Untitled

Sep 21st, 2022 (edited)
855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Globalization;
  3. namespace FilmRating
  4. {    
  5.     class Program
  6.     {
  7.         static int calculateTask(double currentScore, double needScore, double countScores)
  8.         {
  9.             if (currentScore <= needScore)
  10.                 return 0;
  11.             if (currentScore < 10 && needScore > 1) { }
  12.                 currentScore += 0.049999999999999999999999999999;
  13.             needScore += 0.049999999999999999999999999999;
  14.             var sumScore = currentScore * countScores;
  15.             var k = (sumScore - needScore * countScores) / (needScore - 1);
  16.             return (int) Math.Round(k); //WA 8
  17.         }
  18.         static void Main()
  19.         {
  20.             var k = Console.ReadLine().Split();
  21.             var x = double.Parse(k[0], CultureInfo.CurrentCulture);
  22.             var y = double.Parse(k[1], CultureInfo.CurrentCulture);
  23.             var n = Int32.Parse(k[2]);
  24.             Console.WriteLine(calculateTask(x, y, n).ToString());
  25.         }
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement