giulio98/xlcost-single-prompt huggingface dataset:
# find four points such that they form a square whose sides are parallel to x and y axes | find the largest square ; map to store which points exist ; mark the available points ; a nested loop to choose the opposite corners of square ; remove the chosen point ; remove the chosen point ; check if the other two points exist ; if the square is largest then store it ; add the removed point ; add the removed point ; display the largest square ; 
def findLargestSquare(points, n):
    m = dict()
    for i in range(n):
        m[(points[i][0], points[i][1])] = m .get(
            (points[i][0], points[i][1]), 0) + 1
    side = -1
    x = -1
    y = -1
    for i in range(n):
        m[(points[i][0], points[i][1])] -= 1
        for j in range(n):
            m[(points[j][0], points[j][1])] -= 1
            if (i != j and (points[i][0] - points[j][0])
                    == (points[i][1] - points[j][1])):
                if (m[(points[i][0], points[j][1])] >
                        0 and m[(points[j][0], points[i][1])] > 0):
                    if (
                        side < abs(
                            points[i][0] -
                            points[j][0]) or (
                            side == abs(
                                points[i][0] -
                                points[j][0]) and (
                                (points[i][0] *
                                 points[i][0] +
                                    points[i][1] *
                                    points[i][1]) < (
                            x *
                            x +
                            y *
                            y)))):
                        x = points[i][0]
                        y = points[i][1]
                        side = abs(points[i][0] - points[j][0])
            m[(points[j][0], points[j][1])] += 1
        m[(points[i][0], points[i][1])] += 1
    if (side != -1):
        print(
            "Side of the square is : ",
            side,
            ",pointsofthesquareare",
            x,
            ",",
            y,
            " ",
            (x + side),
            ", ",
            y,
            " ",
            (x),
            ", ",
            (y + side),
            " ",
            (x + side),
            ", ",
            (y + side))
    else:
        print("No such square")


n = 6
points = [[1, 1], [4, 4], [3, 4], [4, 3], [1, 4], [4, 1]]
findLargestSquare(points, n)

# Expected output:
Side of the square is :  3 ,pointsofthesquareare 1 , 1   4 ,  1   1 ,  4   4 ,  4
# find length of diagonal of hexagon | function to find the diagonal of the hexagon ; side cannot be negative ; diagonal of the hexagon ; 
def hexadiagonal(a):
    if (a < 0):
        return -1
    return 2 * a


if __name__ == '__main__':
    a = 4
    print(hexadiagonal(a))

# Expected output:
8
# program to find the side of the octagon inscribed within the square | python 3 program to find the side of the octagon which can be inscribed within the square ; function to find the side of the octagon ; side cannot be negative ; side of the octagon ; 

from math import sqrt


def octaside(a):
    if a < 0:
        return -1
    s = a / (sqrt(2) + 1)
    return s


if __name__ == '__main__':
    a = 4
    print("{0:.6}".format(octaside(a)))

# Expected output:
1.65685
# check whether it is possible to join two points given on circle such that distance between them is k | python3 program to implement above approach ; return distance between the centers ; distance between centers ; case 5 ; subcase 1 ; subcase 2 ; case 1 ; case 3 ; case 4 ; case 2 ; since value of k wialways be an integer ; 

from math import sqrt, ceil, floor


def dis(x1, y1, x2, y2):
    return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))


def check(c1, c2, k):
    min = 0
    max = 0
    de = dis(c1[0], c1[1], c2[0], c2[1])
    if (de == 0):
        if (c1[2] == c2[2]):
            min = 0
            max = 0
        else:
            if (c1[2] - c2[2] > 0):
                min = c1[2] - c2[2]
                max = min + 2 * c2[2]
            else:
                min = c2[2] - c1[2]
                max = min + 2 * c1[2]
    elif (de >= c1[2] + c2[2]):
        min = de - c1[2] - c2[2]
        max = de + c1[2] + c2[2]
    elif (de + c2[2] < c1[2]):
        max = c2[2] + c1[2] + de
        min = c1[2] - de - c2[2]
    elif (de + c1[2] < c2[2]):
        max = c2[2] + c1[2] + de
        min = c2[2] - de - c1[2]
    elif ((de + c2[2] >= c1[2]) or (de + c1[2] >= c2[2])):
        max = c2[2] + c1[2] + de
        min = 0
    temin = ceil(min)
    re = max
    if (k >= temin and k <= re):
        return True
    return False


circle1 = [0, 0, 5]
circle2 = [8, 3, 2]
k = 3
if (check(circle1, circle2, k)):
    print("YES")
else:
    print("NO")

# Expected output:
YES
# check if it is possible to move from ( 0 , 0 ) to ( x , y ) in n steps | function to check whether it is possible or not to move from ( 0 , 0 ) to ( x , y ) in exactly n steps ; 
def Arrive(a, b, n):
    if (n >= abs(a) + abs(b) and (n - (abs(a) + abs(b))) % 2 == 0):
        return True
    return False


a = 5
b = 5
n = 11
if (Arrive(a, b, n)):
    print("Yes")
else:
    print("No")

# Expected output:
No
# check if it is possible to move from ( a , 0 ) to ( b , 0 ) with given jumps | function to check if it is possible ; 
def Move(a, x, b):
    if ((((b - a) % x == 0) or ((b - a - 1) % x == 0) and a + 1 != b) and b >= a):
        return True
    return False


if __name__ == "__main__":
    a = 3
    x = 2
    b = 7
    if (Move(a, x, b)):
        print("Yes")
    else:
        print("No")

# Expected output:
Yes
# area of a triangle inscribed in a rectangle which is inscribed in an ellipse | function to find the area of the triangle ; length of a and b cannot be negative ; area of the triangle ; 
def area(a, b):
    if (a < 0 or b < 0):
        return -1
    A = a * b
    return A


if __name__ == '__main__':
    a = 5
    b = 2
    print(area(a, b))

# Expected output:
10
# circumradius of the rectangle | python program to find the radius of the circumcircle of the 

import math


def findRadiusOfcircumcircle(l, b):
    if (l < 0 or b < 0):
        return -1
    radius = (math .sqrt(pow(l, 2) + pow(b, 2)) / 2)
    return radius


l = 4
b = 3
print(findRadiusOfcircumcircle(l, b))

# Expected output:
2.5
# area of the circumcircle of any triangles with sides given | python3 program to find the area the circumcircle of the 

import math


def circlearea(a, b, c):
    if (a < 0 or b < 0 or c < 0):
        return -1
    p = (a + b + c) / 2
    At = math .sqrt(p * (p - a) * (p - b) * (p - c))
    A = 3.14 * pow(((a * b * c) / (4 * At)), 2)
    return A


a = 4
b = 5
c = 3
print(float(circlearea(a, b, c)))

# Expected output:
19.625
# program to find the surface area of the square pyramid | function to find the surface area ; 
def surfaceArea(b, s):
    return 2 * b * s + pow(b, 2)


if __name__ == "__main__":
    b = 3
    s = 4
    print(surfaceArea(b, s))

# Expected output:
33
# area of largest triangle that can be inscribed within a rectangle | function to find the area of the triangle ; a and b cannot be negative ; area of the triangle ; 
def trianglearea(l, b):
    if (l < 0 or b < 0):
        return -1
    area = (l * b) / 2
    return area


l = 5
b = 4
print(trianglearea(l, b))

# Expected output:
10.0
# check if any square ( with one colored cell ) can be divided into two equal parts | function to check if it 's possible to divide the square in two equal parts ; if the painted square is linked anyway to the center of the square then it 's  not possible ; else yes it 's possible ; 
def halfsquare(n, x, y):
    half = n // 2
    if ((half == x or half == x - 1) and (half == y or half == y - 1)):
        print("NO")
    else:
        print("YES")


if __name__ == "__main__":
    n = 100
    x, y = 51, 100
    halfsquare(n, x, y)

# Expected output:
YES
# check if it is possible to reach vector b by rotating vector a and adding vector c to it | function to check if vector b is possible from vector a ; if d = 0 , then you need to add nothing to vector a ; for all four quadrants ; 
def check(a, b, p, q):
    d = p * p + q * q
    if (d == 0):
        return a == 0 and b == 0
    else:
        return ((a * p + b * q) % d == 0 and (b * p - a * q) % d == 0)


def checks(a, b, x, y, p, q):
    if (check(a - x, b - y, p, q) or check(a + x, b + y, p, q)
            or check(a - y, b + x, p, q) or check(a + y, b - x, p, q)):
        return True
    else:
        return False


a = -4
b = -2
x = 0
y = 0
p = -2
q = -1
if (checks(a, b, x, y, p, q)):
    print("Yes")
else:
    print("No")

# Expected output:
Yes
# largest triangle that can be inscribed in an ellipse | python 3 program to find the biggest triangle which can be inscribed within the ellipse ; function to find the area of the triangle ; a and b cannot be negative ; area of the triangle ; 

from math import *


def trianglearea(a, b):
    if a < 0 or b < 0:
        return -1
    area = (3 * sqrt(3) * pow(a, 2)) / (4 * b)
    return area


if __name__ == "__main__":
    a, b = 4, 2
    print(round(trianglearea(a, b), 4))

# Expected output:
10.3923
# area of the largest square that can be inscribed in an ellipse | function to find the area of the square ; a and b cannot be negative ; area of the square ; 
def squarearea(a, b):
    if (a < 0 or b < 0):
        return -1
    area = 4 * (((pow(a, 2) + pow(b, 2)) / (pow(a, 2) * pow(b, 2))))
    return area


if __name__ == '__main__':
    a = 4
    b = 2
    print(squarearea(a, b))

# Expected output:
1.25
# largest triangle that can be inscribed in a semicircle | function to find the area of the triangle ; the radius cannot be negative ; area of the triangle ; 
def trianglearea(r):
    if r < 0:
        return -1
    return r * r


if __name__ == "__main__":
    r = 5
    print(trianglearea(r))

# Expected output:
25
# largest square that can be inscribed in a semicircle | function to find the area of the square ; the radius cannot be negative ; area of the square ; 
def squarearea(r):
    if (r < 0):
        return -1
    a = 4 * (pow(r, 2) / 5)
    return a


if __name__ == "__main__":
    r = 5
    print(int(squarearea(r)))

# Expected output:
20
# area of largest rectangle that can be inscribed in an ellipse | function to find the area of the rectangle ; a and b cannot be negative ; area of the rectangle ; 
def rectanglearea(a, b):
    if a < 0 or b < 0:
        return -1
    return 2 * a * b


if __name__ == "__main__":
    a, b = 10, 8
    print(rectanglearea(a, b))

# Expected output:
160
# area of a largest square fit in a right angle triangle | function to find the area of the biggest square ; the height or base or hypotenuse cannot be negative ; side of the square ; squaring to get the area ; 
def squareArea(l, b, h):
    if l < 0 or b < 0 or h < 0:
        return -1
    a = (l * b) / (l + b)
    return a * a


if __name__ == "__main__":
    l, b, h = 5, 12, 13
    print(round(squareArea(l, b, h), 4))

# Expected output:
12.4567
# queries to check if it is possible to join boxes in a circle | python 3 implementation of above approach ; print the answer to each query ; setting the flag for exception ; replacing the greater element in i and j ; checking if that box is not used in previous query . ; checking if connecting to the same box ; case 1 : x < i and y lies between i and j ; case 2 : x lies between i and j and y > j ; if flag is not reset inbetween . ; 

MAX = 50


def solveQuery(n, q, qi, qj):
    arr = [None] * MAX
    for i in range(n + 1):
        arr[i] = 0
    for k in range(q):
        flag = 0
        if (qj[k] < qi[k]):
            qj[k], qi[k] = qi[k], qj[k]
        if (arr[qi[k]] != 0 or arr[qj[k]] != 0):
            flag = 1
        elif (qi[k] == qj[k]):
            flag = 1
        else:
            for i in range(1, qi[k]):
                if (arr[i] != 0 and arr[i] < qj[k] and qi[k] < arr[i]):
                    flag = 1
                    break
            if (flag == 0):
                for i in range(qi[k] + 1, qj[k]):
                    if (arr[i] != 0 and arr[i] > qj[k]):
                        flag = 1
                        break
        if (flag == 0):
            print("YES")
            arr[qi[k]] = qj[k]
            arr[qj[k]] = qi[k]
        else:
            print("NO")


if __name__ == "__main__":
    n = 10
    q = 7
    qi = [1, 2, 2, 2, 9, 10, 8]
    qj = [5, 7, 3, 4, 9, 9, 6]
    solveQuery(n, q, qi, qj)

# Expected output:
YES
NO
YES
NO
NO
YES
YES
# minimum squares to cover a rectangle | python3 program to find the minimum number of squares to cover the surface of the rectangle with given dimensions ; function to count the number of squares that can cover the surface of the rectangle ; 

import math


def squares(l, b, a):
    return math .ceil(l / a) * math .ceil(b / a)


if __name__ == "__main__":
    l = 11
    b = 23
    a = 14
    print(squares(l, b, a))

# Expected output:
2
# smallest square formed with given rectangles | recursive function to return gcd of a and b ; everything divides 0 ; base case ; a is greater ; function to find the area of the smallest square ; the length or breadth or side cannot be negative ; lcm of length and breadth ; squaring to get the area ; 
def gcd(a, b):
    if (a == 0 or b == 0):
        return 0
    if (a == b):
        return a
    if (a > b):
        return gcd(a - b, b)
    return gcd(a, b - a)


def squarearea(l, b):
    if (l < 0 or b < 0):
        return -1
    n = (l * b) / gcd(l, b)
    return n * n


if __name__ == '__main__':
    l = 6
    b = 4
    print(int(squarearea(l, b)))

# Expected output:
144
# find all angles of a triangle in 3d | python code for finding all angles of a triangle ; function for finding the angle ; 

import math


def angle_triangle(x1, x2, x3, y1, y2, y3, z1, z2, z3):
    num = (x2 - x1) * (x3 - x1) + (y2 - y1) * (y3 - y1) + (z2 - z1) * (z3 - z1)
    den = math .sqrt((x2 - x1)**2 + (y2 - y1)**2 + (z2 - z1)**2) * \
        math .sqrt((x3 - x1)**2 + (y3 - y1)**2 + (z3 - z1)**2)
    angle = math .degrees(math .acos(num / den))
    return round(angle, 3)


x1 = -1
y1 = 3
z1 = 2
x2 = 2
y2 = 3
z2 = 5
x3 = 3
y3 = 5
z3 = -2
angle_A = angle_triangle(x1, x2, x3, y1, y2, y3, z1, z2, z3)
angle_B = angle_triangle(x2, x3, x1, y2, y3, y1, z2, z3, z1)
angle_C = angle_triangle(x3, x2, x1, y3, y2, y1, z3, z2, z1)
print("Angles are :")
print("angle A = ", angle_A, "degree")
print("angle B = ", angle_B, "degree")
print("angle C = ", angle_C, "degree")

# Expected output:
Angles are :
angle A =  90.0 degree
angle B =  54.736 degree
angle C =  35.264 degree
# minimum number of square tiles required to fill the rectangular floor | function to find the number of tiles ; if breadth is divisible by side of square ; tiles required is n / s ; one more tile required ; if length is divisible by side of square ; tiles required is m / s ; one more tile required ; 
def solve(M, N, s):
    if (N % s == 0):
        N = N // s
    else:
        N = (N // s) + 1
    if (M % s == 0):
        M = M // s
    else:
        M = (M // s) + 1
    return M * N


if __name__ == "__main__":
    N, M, s = 12, 13, 4
    print(solve(M, N, s))

# Expected output:
12
# minimum number of square tiles required to fill the rectangular floor | python 3 implementation of above approach ; function to find the number of tiles ; no of tiles ; 

import math


def solve(M, N, s):
    ans = ((math .ceil(M / s)) * (math .ceil(N / s)))
    return ans


if __name__ == "__main__":
    N = 12
    M = 13
    s = 4
    print(solve(M, N, s))

# Expected output:
12
# program to find equation of a plane passing through 3 points | function to find equation of plane . ; 
def equation_plane(x1, y1, z1, x2, y2, z2, x3, y3, z3):
    a1 = x2 - x1
    b1 = y2 - y1
    c1 = z2 - z1
    a2 = x3 - x1
    b2 = y3 - y1
    c2 = z3 - z1
    a = b1 * c2 - b2 * c1
    b = a2 * c1 - a1 * c2
    c = a1 * b2 - b1 * a2
    d = (-a * x1 - b * y1 - c * z1)
    print("equation of plane is ",)
    print(a, "x +",)
    print(b, "y +",)
    print(c, "z +",)
    print(d, "= 0.")


x1 = -1
y1 = 2
z1 = 1
x2 = 0
y2 = -3
z2 = 2
x3 = 1
y3 = 1
z3 = -4
equation_plane(x1, y1, z1, x2, y2, z2, x3, y3, z3)

# Expected output:
equation of plane is 
26 x +
7 y +
9 z +
3 = 0.
# perpendicular distance between a point and a line in 2 d | python program to find the distance between a given point and a given line in 2 d . ; function to find distance ; 

import math


def shortest_distance(x1, y1, a, b, c):
    d = abs((a * x1 + b * y1 + c)) / (math .sqrt(a * a + b * b))
    print("Perpendicular distance is"), d


x1 = 5
y1 = 6
a = -2
b = 3
c = 4
shortest_distance(x1, y1, a, b, c)

# Expected output:
Perpendicular distance is
# program to determine the octant of the axial plane | function to print octant ; 
def octant(x, y, z):
    if x >= 0 and y >= 0 and z >= 0:
        print("Point lies in 1st octant")
    elif x < 0 and y >= 0 and z >= 0:
        print("Point lies in 2nd octant")
    elif x < 0 and y < 0 and z >= 0:
        print("Point lies in 3rd octant")
    elif x >= 0 and y < 0 and z >= 0:
        print("Point lies in 4th octant")
    elif x >= 0 and y >= 0 and z < 0:
        print("Point lies in 5th octant")
    elif x < 0 and y >= 0 and z < 0:
        print("Point lies in 6th octant")
    elif x < 0 and y < 0 and z < 0:
        print("Point lies in 7th octant")
    elif x >= 0 and y < 0 and z < 0:
        print("Point lies in 8th octant")


x, y, z = 2, 3, 4
octant(x, y, z)
x, y, z = -4, 2, -8
octant(x, y, z)
x, y, z = -6, -2, 8
octant(x, y, z)

# Expected output:
Point lies in 1st octant
Point lies in 6th octant
Point lies in 3rd octant
# number of triangles in a plane if no more than two points are collinear | function to find number of triangles in a plane . ; formula to find number of triangles nc3 = n * ( n - 1 ) * ( n - 2 ) / 6 ; 
def countNumberOfTriangles(n):
    return (n * (n - 1) * (n - 2) // 6)


if __name__ == '__main__':
    n = 4
    print(countNumberOfTriangles(n))

# Expected output:
4
# centered dodecagonal number | function to calculate centered dodecagonal number ; formula to calculate nth centered dodecagonal number ; 
def centeredDodecagonal(n):
    return 6 * n * (n - 1) + 1


n = 2
print(centeredDodecagonal(n))
n = 9
print(centeredDodecagonal(n))

# Expected output:
13
433
# centered tridecagonal number | function to find centered tridecagonal number ; formula to calculate nth centered tridecagonal number ; 
def centeredTridecagonalNum(n):
    return (13 * n * (n - 1) + 2) // 2


if __name__ == '__main__':
    n = 3
    print(centeredTridecagonalNum(n))
    n = 10
    print(centeredTridecagonalNum(n))

# Expected output:
40
586
# pentagonal pyramidal number | function to get nth pentagonal pyramidal number . ; running loop from 1 to n ; get nth pentagonal number ; add to sum ; 
def pentagon_pyramidal(n):
    sum = 0
    for i in range(1, n + 1):
        p = (3 * i * i - i) / 2
        sum = sum + p
    return sum


n = 4
print(int(pentagon_pyramidal(n)))

# Expected output:
40
# pentagonal pyramidal number | function to get nth pentagonal pyramidal number . ; 
def pentagon_pyramidal(n):
    return n * n * (n + 1) / 2


n = 4
print(int(pentagon_pyramidal(n)))

# Expected output:
40
# check if three straight lines are concurrent or not | return true if three line are concurrent , else false . ; 
def checkConcurrent(a1, b1, c1, a2, b2, c2, a3, b3, c3):
    return (a3 * (b1 * c2 - b2 * c1) + b3 *
            (c1 * a2 - c2 * a1) + c3 * (a1 * b2 - a2 * b1) == 0)


a1 = 2
b1 = -3
c1 = 5
a2 = 3
b2 = 4
c2 = -7
a3 = 9
b3 = -5
c3 = 8
if (checkConcurrent(a1, b1, c1, a2, b2, c2, a3, b3, c3)):
    print("Yes")
else:
    print("No")

# Expected output:
Yes
# centered octadecagonal number | centered octadecagonal number function ; formula to calculate nth centered octadecagonal number & return it into main function . ; 
def center_octadecagon_num(n):
    return (9 * n * n - 9 * n + 1)


if __name__ == '__main__':
    n = 3
    print(n, "rd centered octadecagonal " +
          "number : ", center_octadecagon_num(n))
    n = 13
    print(n, "th centered octadecagonal " +
          "number : ", center_octadecagon_num(n))

# Expected output:
3 rd centered octadecagonal number :  55
13 th centered octadecagonal number :  1405
# centered decagonal number | centered decagonal number function ; formula to calculate nth centered decagonal number & return it into main function . ; 
def centereddecagonalnum(n):
    return (5 * n * n + 5 * n + 1)


if __name__ == '__main__':
    n = 5
    print(n, "th centered decagonal " + "number : ", centereddecagonalnum(n))
    n = 9
    print(n, "th centered decagonal " + "number : ", centereddecagonalnum(n))

# Expected output:
5 th centered decagonal number :  151
9 th centered decagonal number :  451
# lexicographically kth smallest way to reach given coordinate from origin | return ( a + b ) ! / a ! b ! ; finding ( a + b ) ! ; finding ( a + b ) ! / a ! ; finding ( a + b ) ! / b ! ; return the kth smallest way to reach given coordinate from origin ; if at origin ; if on y - axis ; decrement y . ; move vertical ; recursive call to take next step . ; if on x - axis ; decrement x . ; move horizontal . ; recursive call to take next step . ; if x + y c x is greater than k ; move horizontal ; recursive call to take next step . ; move vertical ; recursive call to take next step . ; 
def factorial(a, b):
    res = 1
    for i in range(1, a + b + 1):
        res = res * i
    for i in range(1, a + 1):
        res = res // i
    for i in range(1, b + 1):
        res = res // i
    return res


def Ksmallest(x, y, k):
    if x == 0 and y == 0:
        return
    elif x == 0:
        y -= 1
        print("V", end="")
        Ksmallest(x, y, k)
    elif y == 0:
        x -= 1
        print("H", end="")
        Ksmallest(x, y, k)
    else:
        if factorial(x - 1, y) > k:
            print("H", end="")
            Ksmallest(x - 1, y, k)
        else:
            print("V", end="")
            Ksmallest(x, y - 1, k - factorial(x - 1, y))


if __name__ == "__main__":
    x, y, k = 2, 2, 2
    Ksmallest(x, y, k)

# Expected output:
HVVH
# centered pentagonal number | function to calculate centered pentagonal number . ; formula to calculate nth centered pentagonal number . ; 
def centered_pentagonal_Num(n):
    return (5 * n * n - 5 * n + 2) // 2


n = 7
print("%sth Centered pentagonal number : " % n, centered_pentagonal_Num(n))

# Expected output:
7th Centered pentagonal number :  106
# maximize a value for a semicircle of given radius | function to find the maximum value of f ; using the formula derived for getting the maximum value of f ; 
def maximumValueOfF(R):
    return 4 * R * R + 0.25


R = 3
print(maximumValueOfF(R))

# Expected output:
36.25
# find the other end point of a line with given one end and mid | function to find the end point of a line ; find end point for x coordinates ; find end point for y coordinates ; 
def otherEndPoint(x1, y1, m1, m2):
    x2 = (2 * m1 - x1)
    y2 = (2 * m2 - y1)
    print("x2 = {}, y2 = {}".format(x2, y2))


x1 = -4
y1 = -1
m1 = 3
m2 = 5
otherEndPoint(x1, y1, m1, m2)

# Expected output:
x2 = 10, y2 = 11
# coordinates of rectangle with given points lie inside | function to print coordinate of smallest rectangle ; find xmax and xmin ; find ymax and ymin ; print all four coordinates ; 
def printRect(X, Y, n):
    Xmax = max(X)
    Xmin = min(X)
    Ymax = max(Y)
    Ymin = min(Y)
    print("{", Xmin, ", ", Ymin, "}", sep="")
    print("{", Xmin, ", ", Ymax, "}", sep="")
    print("{", Xmax, ", ", Ymax, "}", sep="")
    print("{", Xmax, ", ", Ymin, "}", sep="")


X = [4, 3, 6, 1, -1, 12]
Y = [4, 1, 10, 3, 7, -1]
n = len(X)
printRect(X, Y, n)

# Expected output:
{-1, -1}
{-1, 10}
{12, 10}
{12, -1}
# check if a line passes through the origin | python program to find if line passing through two coordinates also passes through origin or not ; 
def checkOrigin(x1, y1, x2, y2):
    return (x1 * (y2 - y1) == y1 * (x2 - x1))


if (checkOrigin(1, 28, 2, 56)):
    print("Yes")
else:
    print("No")

# Expected output:
Yes