import java.util.Arrays;

public class DivisionTest {
	int n;
	int[] x;
	int[] y;
	int[] mapX;
	int[] mapY;
	int up = (int) 1e+9;
	boolean isSample;

	public DivisionTest(int[] x, int[] y,int nX, int nY, boolean... isSample) {
		this.x = x;
		this.y = y;
		this.n = x.length;
		mapX = TestsGen.rnd.nextDiffIntegers(nX, -up, up);
		mapY = TestsGen.rnd.nextDiffIntegers(nY, -up, up);
		Arrays.sort(mapX);
		Arrays.sort(mapY);
		if (isSample.length > 0) {
			this.isSample = isSample[0];
		}
	}

	public String toString() {
		int[] a = TestsGen.rnd.getRandomPermutation(n);
		StringBuilder ans = new StringBuilder(n + "\r\n");
		for (int i = 0; i < n; i++) {
			if (!isSample) {
				ans.append(mapX[x[a[i]]] + " " + mapY[y[a[i]]] + "\r\n");
			} else {
				ans.append(x[i] + " " + y[i] + "\r\n");
			}
		}
		return ans.toString();
	}
}
