Boundary

아직 제출이 없습니다시간 제한2초메모리 제한2048 MB

문제

Bethany would like to tile her bathroom. The bathroom has width ww centimeters and length ll centimeters. If Bethany simply used the basic tiles of size 1×11 × 1 centimeters, she would use wlw · l of them.

However, she has something different in mind.

  • On the interior of the floor she wants to use the 1×11 × 1 tiles. She needs exactly (w2)(l2)(w - 2) · (l - 2) of these.
  • On the floor boundary she wants to use tiles of size 1×a1 × a for some positive integer aa. The tiles can also be rotated by 9090 degrees.

For which values of aa can Bethany tile the bathroom floor as described? Note that aa can also be 11.

입력

Each test contains multiple test cases. The first line contains an integer tt (1t1001 ≤ t ≤ 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 ≤ w, l ≤ 10^9) — the dimensions of the bathroom.

출력

For each test case, print an integer kk (0k0 ≤ k) — the number of valid values of aa for the given test case — followed by kk integers a_1a\_1, a_2a\_2, \dots, a_ka\_k (1a_i1 ≤ a\_i) — the valid values of aa. The values a_1a\_1, a_2a\_2, \dots, a_ka\_k have to be sorted from smallest to largest.

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