Product of Two Numbers 2
Time limit2sMemory limit512 MB
Given a, b, c, choose positive A, B, C with A*B=C minimizing |A-a|+|B-b|+|C-c|.
- Level
Hard8 of 10
- Topics
- Math, Number theory, Brute force
- Solved
- No attempts yet
Problem
You are given positive integers , , and . Among all positive integers , , and with , find the smallest possible value of .
is the absolute value of .
Input
The first line contains , , and , separated by spaces. ()
Output
Print the minimum value of on the first line. , , and must all be positive integers with .