Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TestNumbers
- {
- class TestNumbers
- {
- static void Main(string[] args)
- {
- var firstLine = int.Parse(Console.ReadLine());
- var secondLine = int.Parse(Console.ReadLine());
- var thirdLine = int.Parse(Console.ReadLine());
- var result = 0;
- var combinations = 0;
- for (int i = firstLine; i >= 1; i--)
- {
- for (int j = 1; j <= secondLine; j++)
- {
- result += 3 * (i * j);
- combinations++;
- if (result >= thirdLine)
- {
- Console.WriteLine($"{combinations} combinations");
- Console.WriteLine($"Sum: {result} >= {thirdLine}");
- return;
- }
- }
- }
- Console.WriteLine($"{combinations} combinations");
- Console.WriteLine($"Sum: {result}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement