{"problem":{"name":"A. Restoring Numbers","description":{"content":"Pavel had two positive integers a and b. He found their sum s and greatest common divisor g, and forgot a and b after that. Help him to restore the original numbers. A single line contains two intege","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10175A"},"statements":[{"statement_type":"Markdown","content":"Pavel had two positive integers a and b. He found their sum s and greatest common divisor g, and forgot a and b after that. Help him to restore the original numbers.\n\nA single line contains two integers s and g (1 ≤ s ≤ 109, 1 ≤ g ≤ 109) — sum and greatest common divisor of the numbers a and b.\n\nIf Pavel made a mistake and there are no such numbers a and b, output a single number  - 1.\n\nOtherwise, output two positive integers a and b on a single line, separated by a space. If there are multiple possible solutions, output any of them.\n\n## Input\n\nA single line contains two integers s and g (1 ≤ s ≤ 109, 1 ≤ g ≤ 109) — sum and greatest common divisor of the numbers a and b.\n\n## Output\n\nIf Pavel made a mistake and there are no such numbers a and b, output a single number  - 1.Otherwise, output two positive integers a and b on a single line, separated by a space. If there are multiple possible solutions, output any of them.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ s, g \\in \\mathbb{Z}^+ $ be given, with $ 1 \\leq s, g \\leq 10^9 $.  \n\n**Constraints**  \nFind positive integers $ a, b \\in \\mathbb{Z}^+ $ such that:  \n1. $ a + b = s $  \n2. $ \\gcd(a, b) = g $  \n\n**Objective**  \nIf such $ a, b $ exist, output any pair $ (a, b) $. Otherwise, output $ -1 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10175A","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}