description: Alice and Borys are playing tennis.
  
  A tennis match consists of games. In each game, one of the players is serving and the other one is receiving.
  
  Players serve in turns: after a game where Alice is serving follows a game where Borys is serving, and vice versa.
  
  Each game ends with a victory of one of the players. If a game is won by the serving player, it's said that this player holds serve. If a game is won by the receiving player, it's said that this player breaks serve.
  
  It is known that Alice won a games and Borys won b games during the match. It is unknown who served first and who won which games.
  
  Find all values of k such that exactly k breaks could happen during the match between Alice and Borys in total.
  
  Input
  
  Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 10^3). Description of the test cases follows.
  
  Each of the next t lines describes one test case and contains two integers a and b (0 ≤ a, b ≤ 10^5; a + b > 0) — the number of games won by Alice and Borys, respectively.
  
  It is guaranteed that the sum of a + b over all test cases does not exceed 2 ⋅ 10^5.
  
  Output
  
  For each test case print two lines.
  
  In the first line, print a single integer m (1 ≤ m ≤ a + b + 1) — the number of values of k such that exactly k breaks could happen during the match.
  
  In the second line, print m distinct integers k_1, k_2, …, k_m (0 ≤ k_1 < k_2 < … < k_m ≤ a + b) — the sought values of k in increasing order.
  
  Example
  
  Input
  
  
  3
  2 1
  1 1
  0 5
  
  
  Output
  
  
  4
  0 1 2 3
  2
  0 2
  2
  2 3
  
  Note
  
  In the first test case, any number of breaks between 0 and 3 could happen during the match: 
  
    * Alice holds serve, Borys holds serve, Alice holds serve: 0 breaks; 
    * Borys holds serve, Alice holds serve, Alice breaks serve: 1 break; 
    * Borys breaks serve, Alice breaks serve, Alice holds serve: 2 breaks; 
    * Alice breaks serve, Borys breaks serve, Alice breaks serve: 3 breaks. 
  
  
  
  In the second test case, the players could either both hold serves (0 breaks) or both break serves (2 breaks).
  
  In the third test case, either 2 or 3 breaks could happen: 
  
    * Borys holds serve, Borys breaks serve, Borys holds serve, Borys breaks serve, Borys holds serve: 2 breaks; 
    * Borys breaks serve, Borys holds serve, Borys breaks serve, Borys holds serve, Borys breaks serve: 3 breaks. 
solution:     import javax.swing.*;
      import java.io.BufferedReader;
      import java.io.IOException;
      import java.io.InputStreamReader;
      import java.io.PrintWriter;
      import java.util.*;
      public class Main extends PrintWriter {
          static BufferedReader s = new BufferedReader(new InputStreamReader(System.in));Main () { super(System.out); }public static void main(String[] args) throws IOException{ Main  d1=new Main   ();d1.main();d1.flush(); }
  
          void main() throws IOException {
              StringBuilder sb = new StringBuilder();
              int t = 1;
              t = i(s()[0]);
              while(t-- > 0) {
                      String[] s1 = s();
                      int a = i(s1[0]); int b = i(s1[1]);
                      int a1 = (a + b + 1) / 2; int b1 = (a + b) / 2;
                      int n = a + b;
                      int br = 0;
                      List<Integer> l = new ArrayList<>();
                      HashMap<Integer, Integer> h = new HashMap<>();
                      for(int i=0;i<n;i++){
                          int flag = 0;
                           if(i % 2 != 0){
                               if(a1 < a){
                                   a1++; b1--; br++;flag = 1;
                               }
                           }else{
                               if(b1 < b){
                                   b1++; a1--; br++;flag = 1;
                               }
                           }
                           if(a1 == a){
                               if(!h.containsKey(br))
                               {l.add(br);
                               h.put(br, 0);}
                               if(flag == 0 && i < n - 1 && !h.containsKey(br + 2)){
                                   br += 2;
                                   l.add(br);
                                 h.put(br, 0);i += 1;
                               }
                           }
                      }br = 0; a1 = (a + b) / 2; b1 = (a + b + 1) / 2;
                      for(int i=0;i<n;i++){
                      int flag = 0;
                      if(i % 2 == 0){
                          if(a1 < a){
                              a1++; b1--; br++;flag = 1;
                          }
                      }else{
                          if(b1 < b){
                              b1++; a1--; br++;flag = 1;
                          }
                      }
                      if(a1 == a){
                          if(!h.containsKey(br))
                          {l.add(br);
                              h.put(br, 0);}
                          if(flag == 0 && i < n - 1 && !h.containsKey(br + 2)){
                              br += 2;
                              l.add(br);
                              h.put(br, 0);i += 1;
                          }
                      }
                  }
                      Collections.sort(l);
                      sb.append(l.size() + "\n");
                      for(Integer j : l){
                          sb.append(j + " ");
                      }sb.append("\n");
              }
              System.out.println(sb);
          }  static long gcd(long a, long b) {
                  if (b == 0)
                      return a;
                  return gcd(b, a % b);
              }
          public void sort(int[] a,int l,int h){
                  if(l==h) return;
                  int mid=(l+h)/2;
  
                  sort(a,l,mid);
                  sort(a,mid+1,h);
                  merge(a,l,(l+h)/2,h);
              }
              void merge(int arr[], int l, int m, int r) {
                  int n1 = m - l + 1;
                  int n2 = r - m;
                  int L[] = new int[n1];
                  int R[] = new int[n2];
                  for (int i = 0; i < n1; ++i)
                      L[i] = arr[l + i];
                  for (int j = 0; j < n2; ++j)
                      R[j] = arr[m + 1 + j];
                  int i = 0, j = 0;
                  int k = l;
                  while (i < n1 && j < n2) {
                      if (L[i] <= R[j]) {
                          arr[k] = L[i];
                          i++;
                      }
                      else {
                          arr[k] = R[j];
                          j++;
                      }
                      k++;
                  }
  
                  while (i < n1) {
                      arr[k] = L[i];
                      i++;
                      k++;
                  }
                  while (j < n2) {
                      arr[k] = R[j];
                      j++;
                      k++;
                  }
              }
          static String[] s() throws IOException { return s.readLine().trim().split("\\s+"); }
          static int i(String ss) {return Integer.parseInt(ss); }
          static long l(String ss) {return Long.parseLong(ss); }
          public void arr(long[] a,int n) throws IOException {String[] s2=s();for(int i=0;i<n;i++){ a[i]=l(s2[i]); }}
          public void arri(int[] a,int n) throws IOException {String[] s2=s();for(int i=0;i<n;i++){ a[i]=(i(s2[i])); }}
  
      }class Pair{
             long a, b;
             public Pair(long a, long b){
                 this.a = a;
                 this.b = b;
          }
      }
  
  
  