Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace RectangleWithStars
- {
- class RectangleWithStars
- {
- static void Main(string[] args)
- {
- uint n = uint.Parse(Console.ReadLine());
- int area = int.Parse(Console.ReadLine());
- var n1 = -1 * n;
- bool found = false;
- for (var x1 = n1; x1 <= n; x1++)
- {
- for (var x2 = n1; x2 <= n; x2++)
- {
- for (var y1 = n1; y1 <= n; y1++)
- {
- for (var y2 = n1; y2 <= n; y2++)
- {
- //var area1 = Math.Abs(x2 - x1) * Math.Abs(y2 - y1);
- if (n1 <= x1 && x1 < x2 && x2 <= n && n1 <= y1 && y1 < y2 && y2 <= n)
- {
- var area1 = Math.Abs(x2 - x1) * Math.Abs(y2 - y1);
- if (area1 >= area)
- {
- found = true;
- Console.WriteLine("({0}, {1}) ({2}, {3}) -> {4}", x1, y1, x2, y2, area1);
- }
- }
- }
- }
- }
- }
- if (found == false)
- {
- Console.WriteLine("No");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement