using System; using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; namespace Csharp { class Program { static void Main(string[] args) { var inputs = Console.ReadLine().Split(); int E = Convert.ToInt32(inputs[0]); int S = Convert.ToInt32(inputs[1]); int M = Convert.ToInt32(inputs[2]); // 중국인의 나머지 정리를 이용하면 // 28 * 19 * s1 % 15 == 1 // 15 * 19 * s2 % 28 == 1 // 15 * 28 * s3 % 19 == 1 // s1 == 13, s2 == 17, s3 == 10 // ans = (E * 28 * 19 * 13 + S * 15 * 19 * 17 + M * 15 * 28 * 10) % (15 * 28 * 19) // = (E * 6916 + S * 4845 + M * 4200) % 7980 int ans = (E * 6916 + S * 4845 + M * 4200) % 7980; Console.WriteLine((ans != 0) ? ans : 7980); } } } |