CF1662H.Boundary
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Each test contains multiple test cases. The first line contains an integer t ( 1≤t≤100 ) — the number of test cases. The descriptions of the t test cases follow.
Each test case consist of a single line, which contains two integers w , l ( 3≤w,l≤109 ) — the dimensions of the bathroom.
输入格式
For each test case, print an integer k ( 0≤k ) — the number of valid values of a for the given test case — followed by k integers a1,a2,…,ak ( 1≤ai ) — the valid values of a . The values a1,a2,…,ak have to be sorted from smallest to largest.
It is guaranteed that under the problem constraints, the output contains at most 200000 integers.
输出格式
In the first test case, the bathroom is 3 centimeters wide and 5 centimeters long. There are three values of a such that Bethany can tile the floor as described in the statement, namely a=1 , a=2 and a=3 . The three tilings are represented in the following pictures.
输入输出样例
输入#1
3 3 5 12 12 314159265 358979323
输出#1
3 1 2 3 3 1 2 11 2 1 2
说明/提示
In the first test case, the bathroom is 3 centimeters wide and 5 centimeters long. There are three values of a such that Bethany can tile the floor as described in the statement, namely a=1 , a=2 and a=3 . The three tilings are represented in the following pictures.