Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication96
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int m = int.Parse(Console.ReadLine());
- int total = int.Parse(Console.ReadLine());
- int counts = 0;
- int result = 0;
- for (int i = 1; i <= n; i++)
- {
- for (int j = m; j >= 1; j--)
- {
- result += i * 2 + j * 3;
- counts++;
- if (result >= total)
- {
- break;
- }
- }
- if (result >= total)
- {
- break;
- }
- }
- if (result<total)
- {
- Console.WriteLine($"{counts} moves");
- }
- else
- {
- Console.WriteLine($"{counts} moves");
- Console.WriteLine($"Score: {result} >= {total}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment