logo AlgoBeat OnlineJudge
登录 注册

#217108. [ICPC 2017 Hong Kong R] Fermat's Optimization Problem

内存限制:512 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Consider the error function , where means the absolute value of . Given two positive integers and , our problem is to find two positive integers and such that and the error value is minimized. There may be multiple values of and that minimize , and you may output any of them.

For example, if we are given and , then the solution is: and . This solution yields the error value .

输入格式

The first line contains the number of test cases (). Each subsequent line corresponds to a test case, which contains two positive integers () and ().

输出格式

For each test case, output the value of , , and in a line, separated by spaces.

样例

样例输入 1

2
3 9
3 7

样例输出 1

6 8 1
5 6 2