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 Generate_Rectangles
- {
- class Program
- {
- static void Main(string[] args)
- {
- int point = int.Parse(Console.ReadLine());
- int minArea = int.Parse(Console.ReadLine());
- int counter = 0;
- for (int left = -point; left <= point; left++)
- {
- for (int top = -point; top <= point; top++)
- {
- for (int right = -point; right <= point; right++)
- {
- for (int bottom = -point; bottom <= point; bottom++)
- {
- if (bottom > top && right > left)
- {
- int leftRightSide = bottom - top;
- int topBottomSide = right - left;
- int area = leftRightSide * topBottomSide;
- if (area >= minArea)
- {
- Console.WriteLine("({0}, {1}) ({2}, {3}) -> {4}", left, top, right, bottom, area );
- counter++;
- }
- }
- }
- }
- }
- }
- if (counter == 0)
- {
- Console.WriteLine("No");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment