Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Runtime.InteropServices;
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int minArea = int.Parse(Console.ReadLine());
- var PrintNo = true;
- for (var left = -n; left <= n; left++)
- {
- for (var top = -n; top <= n; top++)
- {
- for (var right = top + 1; right <= n; right++)
- {
- for (var bottom = left + 1; bottom <= n; bottom++)
- {
- var width = bottom - left;
- var height = right - top;
- var area = width * height;
- if (area >= minArea)
- {
- Console.WriteLine("({0}, {1}) ({2}, {3}) -> {4}", left, top, bottom, right, area);
- PrintNo = false;
- }
- }
- }
- }
- }
- if (PrintNo) { Console.WriteLine("No"); }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement