Under construction

Still being built. Things may change

Unit Test

Time limit1sMemory limit1024 MB

Summary
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 aa, bb, and cc are given on one line, separated by spaces.

In a single circle, aa is the number at the upper left, bb is the number at the upper right, and cc is the number at the bottom. A blank is given as 00.

For example, the rightmost circle in the figure is given as 105105 00 1212.

Output

Print the positive integer that goes in the blank. Only inputs that have an answer are given.

Constraints

  • 0≤a,b,c≤1040 \le a, b, c \le 10^4
  • Exactly one of aa, bb, cc is 00, and the other two are positive integers.

Examples3

  1. Example 1

    Input
    47 53 0
    
    Expected output
    10
    
  2. Example 2

    Input
    0 69 10
    
    Expected output
    31
    
  3. Example 3

    Input
    23 0 7
    
    Expected output
    26