CCC 2020 J3 - Art Solution
← Back to Forum

CCC 2020 J3 - Art Solution

#Morgan Su, BayviewSS
N=int(input())
hcX=-1
hcY=-1
lX=101
lY=101
#Variables for points extrema

for i in range(N):
    coord=input()
    length=len(coord)
    value=coord.index(",")

  #split string into x and y integers
    x=int(coord[0:value])
    y=int(coord[value+1:length])

  #Update coordinate bounds
    if(x>hcX):
        hcX=x
    if(y>hcY):
        hcY=y
    if(y<lY):
        lY=y
    if(x<lX):
        lX=x

#print bottom left and top right of the frame
print(lX-1, end=",")
print(lY-1)
print(hcX+1, end=",")
print(hcY+1)
By msu7 on 8/25/2025
0

Comments