Roy wants to change his profile picture on Facebook. Now Facebook has some restriction over the dimension of picture that we can upload.
Minimum dimension of the picture can be L x L, where L is the length of the side of square.
Now Roy has N photos of various dimensions.
Dimension of a photo is denoted as W x H
where W - width of the photo and H - Height of the photo
Dimension of a photo is denoted as W x H
where W - width of the photo and H - Height of the photo
When any photo is uploaded following events may occur:
[1] If any of the width or height is less than L, user is prompted to upload another one. Print "UPLOAD ANOTHER" in this case.
[2] If width and height, both are large enough and
(a) if the photo is already square then it is accepted. Print "ACCEPTED" in this case.
(b) else user is prompted to crop it. Print "CROP IT" in this case.
[2] If width and height, both are large enough and
(a) if the photo is already square then it is accepted. Print "ACCEPTED" in this case.
(b) else user is prompted to crop it. Print "CROP IT" in this case.
-------------------------------------------------------------------
# Write your code here
l_=int(input())
case_=int(input())
while(case_!=0):
dimes_=input()
if(len(dimes_.split(" "))==2):
w_,h_=dimes_.split(" ")
w_=int(w_)
h_=int(h_)
if(w_ < l_ or h_ < l_):
print("UPLOAD ANOTHER")
elif(w_ == h_ and w_ >= l_ and h_ >= l_):
print("ACCEPTED")
elif(w_ != h_ and w_ >= l_ and h_ >= l_):
print("CROP IT")
case_-=1
--------------------------------------------------------------------
Write your own code in any language and share....
Comments
Post a Comment
Thanks in anticipation.