import java.io.*;
import java.util.*;




public class TestGen {

    static PrintWriter out;
    static Random rnd = new Random(0);
    static int tNumber;
    
    static void printTest(int[] pts) throws IOException {
        if (tNumber < 10)
            out = new PrintWriter("../tests/0" + tNumber);
        else
            out = new PrintWriter("../tests/" + tNumber);
        tNumber++;
        out.println(pts.length / 2);
        for (int i = 0; i < pts.length; i+= 2) 
            out.println(pts[i] + " " + pts[i + 1]);
        out.close();        
    }
    
    static void genSample() throws FileNotFoundException {
        out = new PrintWriter("../tests/01");               
        out.println("8");
        out.println("2 2");
        out.println("2 5");
        out.println("3 3");
        out.println("4 5");
        out.println("4 2");
        out.println("5 6");
        out.println("7 4");
        out.println("6 0");
        out.close();                
    }
    
    static int randFromTo(int l, int r) {
        return rnd.nextInt(r - l + 1) + l;      
    }

    static int[] genArray(int n, int mx) {
        int[] ans = new int[2 * n];
        for (int i = 0; i < 2 * n; i += 2) { 
            int x = 0;
            int y = 0;
            boolean good = false;
            while (!good) {
                x = randFromTo(-mx, mx);
                y = randFromTo(-mx, mx);            
                good = true;
                for (int j = 0; j + 1 < i; j += 2) {
                    if (ans[j] == x && ans[j + 1] == y) {
                        good = false;
                        break;
                    }
                }
            }
            ans[i] = x;
            ans[i + 1] = y;
        }
        return ans;
    } 
        
    public static void main(String[] args) throws IOException {
        genSample();
        tNumber = 2;              
        printTest(genArray(3, 10));
        printTest(genArray(4, 10));
        printTest(genArray(5, 10));
        for (int i = 0; i < 5; ++i) 
            printTest(genArray(10 + i, 100000));
        for (int i = 0; i < 5; ++i) 
            printTest(genArray(100, 100000));
        for (int i = 0; i < 10; ++i) 
            printTest(genArray(1000, 100000));                                                      
    }
}
