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 1787. Turn for MEGA

C# неправильный ответ
Posted by Ivan_Popovich 16 Dec 2018 15:45
помогите найти ошибку. вроде ответы правильные выдаёт


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] a = Console.ReadLine().Split();
            int b = Convert.ToInt32(a[0]);
            int c = Convert.ToInt32(a[1]);
            int d = 0;
            string[] e = Console.ReadLine().Split();
            for (int f = 0; f < c; f++ )
            {
                d = d + Convert.ToInt32(e[f]);
            }
            int g = d - b * c;
            if (g < 0)
            {
                g = 0;
            }
            Console.WriteLine(g);
            Console.ReadLine();
        }
    }
}