#sdpsgssolutions #Concealed Coconut #AIO 2017 (Senior) # Open the input and output files. inputFile = open("cocoin.txt", "r") outputFile = open("cocoout.txt", "w") # Read how many numbers there will be myInput = inputFile.readline().split() Ix = int(myInput[0]) Iy = int(myInput[1]) Id = int(myInput[2]) myInput = inputFile.readline().split() Cx = int(myInput[0]) Cy = int(myInput[1]) Cd = int(myInput[2]) # Find distance between I and Cd distance = ((Ix-Cx)**2+(Iy-Cy)**2)**(0.5) # Is the sum of Id and Cd greater than or equal to the distances? # If yes then the circles intersect, if no then the circles do no intersect # First check whether one circle is inside another circle if ((Id-Cd)**2)**(0.5)>distance: decision = "no" else: if Id+Cd>=distance: decision = "yes" else: decision = "no" outputFile.write(str(decision)) # Finally, close the input/output files. inputFile.close() outputFile.close()