Unit Test
Time limit1sMemory limit1024 MB
Given the two top numbers and the bottom number of a circle with one blank (0), print the positive integer for the blank so the top pair sums to the bottom number squared.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Jaehwi was looking through math problems to write a quiz and found a simple one.

This problem is from a middle school first-year unit test, and the task is to find the number for the blank. Jaehwi thought about the answer all day but could not work it out. Spending so long on it, Jaehwi did not make it to DSPC to set problems. The intended answer is that the two numbers on the top of a circle add up to the square of the number below it. Write a program that solves the problem so Jaehwi can set it.
Input
Three integers , , and are given on one line, separated by spaces.
In a single circle, is the number at the upper left, is the number at the upper right, and is the number at the bottom. A blank is given as .
For example, the rightmost circle in the figure is given as .
Output
Print the positive integer that goes in the blank. Only inputs that have an answer are given.
Constraints
- Exactly one of , , is , and the other two are positive integers.