Write a programIntermediate30 XPExercise 7/16

Mind reader

Task

Think of two whole numbers and tell the program only their sum and difference (the first minus the second), each on its own line. The program works out the original numbers and prints them on one line separated by a space - the first, then the second.

Handle bad input: if an input is not a whole number, print zly vstup (bad input) and read that same value again. If no whole numbers have the given sum and difference, print ziadne cele cisla (no whole numbers).

What the program should do

A sum of 10 and a difference of 4 mean the numbers 7 and 3.

Examples

  • Input

    10
    4

    Expected output

    7 3
  • Input

    abc
    10
    4

    Expected output

    zly vstup
    7 3

After you submit, 4 hidden tests will also check your solution: a negative number, no whole numbers, several bad inputs, zeros.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.