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 ConsoleApp38
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int m = int.Parse(Console.ReadLine());
- int control = int.Parse(Console.ReadLine());
- int sum = 0;
- int count = 0;
- for (int i = 1; i <= n; i++)
- {
- for (int j = m; j >= 1; j--)
- {
- if (sum>=control)
- {
- break;
- }
- sum = sum + (i * 2) + (j * 3);
- count++;
- }
- }
- if (sum >= control)
- {
- Console.WriteLine($"{count} moves");
- Console.WriteLine($"Score: {sum} >= {control}");
- }
- else
- {
- Console.WriteLine($"{count} moves");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment