CF1662H.Boundary

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Each test contains multiple test cases. The first line contains an integer tt ( 1t1001\le t\le 100 ) — the number of test cases. The descriptions of the tt test cases follow.

Each test case consist of a single line, which contains two integers ww , ll ( 3w,l1093 \leq w, l \leq 10^{9} ) — the dimensions of the bathroom.

输入格式

For each test case, print an integer kk ( 0k0\le k ) — the number of valid values of aa for the given test case — followed by kk integers a1,a2,,aka_1, a_2,\dots, a_k ( 1ai1\le a_i ) — the valid values of aa . The values a1,a2,,aka_1, a_2, \dots, a_k have to be sorted from smallest to largest.

It is guaranteed that under the problem constraints, the output contains at most 200000200\,000 integers.

输出格式

In the first test case, the bathroom is 33 centimeters wide and 55 centimeters long. There are three values of aa such that Bethany can tile the floor as described in the statement, namely a=1a=1 , a=2a=2 and a=3a=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 33 centimeters wide and 55 centimeters long. There are three values of aa such that Bethany can tile the floor as described in the statement, namely a=1a=1 , a=2a=2 and a=3a=3 . The three tilings are represented in the following pictures.

首页