You are given a number $$$k$$$ and a string $$$s$$$ of length $$$n$$$, consisting of the characters '.' and '*'. You want to replace some of the '*' characters with 'x' characters so that the following conditions are met:   The first character '*' in the original string should be replaced with 'x';  The last character '*' in the original string should be replaced with 'x';  The distance between two neighboring replaced characters 'x' must not exceed $$$k$$$ (more formally, if you replaced characters at positions $$$i$$$ and $$$j$$$ ($$$i < j$$$) and at positions $$$[i+1, j-1]$$$ there is no "x" symbol, then $$$j-i$$$ must be no more than $$$k$$$). For example, if $$$n=7$$$, $$$s=$$$.**.*** and $$$k=3$$$, then the following strings will satisfy the conditions above:   .xx.*xx;  .x*.x*x;  .xx.xxx.  But, for example, the following strings will not meet the conditions:   .**.*xx (the first character '*' should be replaced with 'x');  .x*.xx* (the last character '*' should be replaced with 'x');  .x*.*xx (the distance between characters at positions $$$2$$$ and $$$6$$$ is greater than $$$k=3$$$). Given $$$n$$$, $$$k$$$, and $$$s$$$, find the minimum number of '*' characters that must be replaced with 'x' in order to meet the above conditions.

The first line contains one integer $$$t$$$ ($$$1 \le t \le 500$$$). Then $$$t$$$ test cases follow. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 50$$$). The second line of each test case contains a string $$$s$$$ of length $$$n$$$, consisting of the characters '.' and '*'. It is guaranteed that there is at least one '*' in the string $$$s$$$. It is guaranteed that the distance between any two neighboring '*' characters does not exceed $$$k$$$.

For each test case output the minimum number of '*' characters that must be replaced with 'x' characters in order to satisfy the conditions above.

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let [n, k] = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let arr = readline().trim().split("");
    if (n === 1) {
      console.log(1);
      continue;
    }
    let start = arr.indexOf("*");
    let cnt = 1;
    while (true) {
      let j = Math.min(n - 1, start + k);
      for (; start < j && arr[j] === "."; j--);
      if (start === j) break;
      cnt++;
      start = j;
    }
    console.log(cnt);
  }
};
solve();

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main();
var mod = 998244353n
var maxN = 10e6 + 1

function main() {
  var x = parseInt(readline())
  //
  Array(parseInt(x)).fill(1).map((t, iii) => {
    // var n = parseInt(readline())
    //   var a = new Array(n)
    //   var marked = new Array(n).fill(false)
    //   var found = new Array(n).fill(false)
    var [n, kk] = readline().split(' ').map((x, iii) => {
      return parseInt(x)
    });
    var a = readline().split('').map((x, iii) => {
      return x
    });

    var next
    for (let i = 0; i < n; i++) {
      if (a[i] === '*') {
        next = i
        break
      }
    }
    var res = 1
    var j = 0
    a[next] === 'X'
    for (let i = 0; i < a.length; i++) {
      j = next
      for (let k = j; k <= j + kk; k++) {
        if (k < a.length && a[k] === '*') next = k
      }
      if (j !== next) {
        a[next] = 'X'
        res++
      }
    }
    console.log(res)

  })
}

var timer = 0;
function dfs(v, prev) {
   var h = {};
   v.__h = h;
   h.tin = ++timer;
   h.up = [];
   var i = 0;
   var next = prev;
   while (next) {
      h.up[i] = next;
      next = next.__h.up[i++];
   }
   var children = v.childNodes;
   for (i = 0; i < children.length; i++) {
      dfs(children[i], v);
   }
   h.tout = ++timer;
}

function solve() {
   var nk = read().split(' ').map(Number);
   var n = nk[0];
   var k = nk[1];
   var str = read();
   var starIndexes = [];
   var lastStarIndex;
   for (var i = 0; i < n; i++) {
      if (str[i] === '*') {
         starIndexes.push(i);
         lastStarIndex = i;
      }
   }
   var firstStarIndex = starIndexes[0];
   var c1 = 1;
   var i = firstStarIndex;
   while (i !== lastStarIndex) {
      i += k;
      while (starIndexes.indexOf(i) === -1) {
         i--;
      }
      c1++;
   }
   var c2 = 1;
   var i = lastStarIndex;
   while (i !== firstStarIndex) {
      i -= k;
      while (starIndexes.indexOf(i) === -1) {
         i++;
      }
      c2++;
   }
   write(Math.min(c1, c2));
}

function init() {
   var T;
   T = 1;
   T = Number(read());
   for (var t = 0; t < T; t++) {
      solve();
   }
}

function sortF(a, b) {
   if (a < b) {
      return -1;
   }
   if (a > b) {
      return 1;
   }
   return 0;
}

function readArray(f) {
   return read().split(' ').map(f);
}

var isNode = typeof console !== 'undefined';
var MEMORY = [];
var MEMORY_INDEX = 0;
if (isNode) {
   var fs = require('fs');
   var path = require('path');

   var inTextName;
   var outTextName;

   var needWriteFile = false;

   var writeResult = '';
   if (process.argv.length === 5) {
      inTextName = process.argv[3];
      outTextName = process.argv[4];
   }

   if (inTextName) {
      fs.readFile(path.join(__dirname, inTextName), 'utf8', (err, data) => {
         MEMORY = data.split('\r\n');
         init();
         if (needWriteFile) {
            fs.writeFile(path.join(__dirname, outTextName), writeResult, (err) => {
               err ? console.error(err) : console.log('good')
            });
         }
      });
   } else {
      MEMORY = fs.readFileSync(0, 'utf-8').split('\r\n');
      init();
   }
} else {
   init();
}

function write(value) {
   if (needWriteFile) {
      writeResult += value + '\n';
      return;
   }
   isNode ? console.log('' + value) : print('' + value);
}
function read() {
   return isNode ? MEMORY[MEMORY_INDEX++] : readline();
}
function readAll() {
   return isNode && MEMORY;
}

const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
let input = [];
rl.on('line', line => {
    input.push(line);
})
rl.on('close', line => {
    let l = Number(input[0]);
    let j = 1;
    for (let i = 0; i < l; i++) {
        var [n, k] = input[j].split(" ").map((i) => {
            return Number(i);
        });
        j++;
        var str = input[j];
        j++;
        function minReplace(n, k, str) {
            var i;
            for (i = 0; i < n; i++) {
                if (str[i] === '*') {
                    break;
                }
            }
            var firstIndex = i;
            for (i = n - 1; i >= 0; i--) {
                if (str[i] === '*') {
                    break;
                }
            }
            var lastIndex = i;
            if (firstIndex === lastIndex) {
                return 1;
            }
            if (firstIndex + k >= lastIndex) {
                return 2;
            }
            var count = 2;
            i = firstIndex;
            while (i + k < lastIndex) {
                var j = i + k;
                while (str[j] !== '*') {
                    j--;
                }
                count++;
                i = j;
            }
            return count;
        }
        console.log(minReplace(n, k, str));
    }
})

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);}
function getCountMap(list){
	var map = {};
	for(var i = 0; i < list.length; i++){
		if(map[list[i]] == null){
			map[list[i]] = 0;
		}
		map[list[i]]++;
	}
	return map;
}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------

function Main(){
	var t = nextInt();
	for(var i = 0; i < t; i++){
		var N = nextInt();
		var K = nextInt();
		var s = nextCharArray();
		var output = 0;
		var L = -1;
		var R = -1;
		for(var j = 0; j < N; j++){
			if(s[j] == "*"){
				s[j] = "x";
				output++;
				L = j;
				break;
			}
		}
		for(var j = N - 1; j >= 0; j--){
			if(s[j] == "*"){
				s[j] = "x";
				output++;
				R = j;
				break;
			}
		}
		if(L == -1 || R == -1){
			myout(output);
			continue;
		}
		var Ls = makeClone(s);
		var Rs = makeClone(s);
		var countL = output;
		var countR = output;
		for(var j = L; j < N; j++){
			if(Ls[j] == "x"){
				if(j + K < R){
					for(var k = j + K; k > j; k--){
						if(Ls[k] == "*"){
							Ls[k] = "x";
							countL++;
							break;
						}
					}
				}

			}
		}
		for(var j = R; j >= 0; j--){
			if(Rs[j] == "x"){
				if(j - K > L){
					for(var k = j - K; k < j; k++){
						if(Rs[k] == "*"){
							Rs[k] = "x";
							countR++;
							break;
						}
					}
				}
			}
		}
		//myerr({Rs, Ls});
		myout(Math.min(countR, countL));
	}
}

///////////////////////////////// pre-define /////////////////////////////////////
const pr = console.log;
///////////////////////////////////////////////////////////////////////////////////

const solve = (n, k, s) => {
    let star = [];
    for (let i = 0; i < n; i++) {
        if (s[i] == '*') star.push(i);
    }
    let len = star.length;
    let res = 1;
    for (let i = 0; i != len - 1;) {
        let j;
        for (j = i + 1; j < len; j++) {
            if (star[j] - star[i] > k) break;
        }
        res++;
        j--;
        i = j;
    }
    pr(res);
};

const main = () => {
    const readline = require('readline');
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });
    let input = [];
    rl.on('line', (line) => {
        input.push(line);
    });
    rl.on('close', () => {
        let t = Number(input[0]);
        let i = 1;
        while (t--) {
            let tmp = input[i].split(" ").map(Number);
            solve(tmp[0], tmp[1], input[i + 1]);
            i += 2;
        }
    });
};

main()

l=readline;
for (T=+l(); T--; ) {
    I = l().split` `.map(Number);
    n = I[0];
    k = I[1];
    S = l();

    c = d = p = 0;
    first = last = false;
    for(i=0; i < S.length; i++) {
        d++;
        if (S[i] == '*') {
            if (!first) {
                first = true;
                last = true;
                c++;
                d = 0;
            } else if (d > k && p > 0) {
                i = p;
                last = true;
                p = d = 0;
                c++;
            } else {
                last = false;
                p = i;
            }
        }
    }
    if (!last) {
        c++;
    }

    print(c)
}

t=+readline()
while(t--){r=readline().split` `
n=+r[0]
k=+r[1]
s=readline()
f=s.indexOf('*')
l=s.lastIndexOf('*')
a=1
j=f
while(true){j=Math.min(j+k,n-1)
for(i=j;i>f;i--){if(s[i]=='*'){f=i
a++;break}}j=f
if(f>=l){break;}}print(a)}

function getInt( num ) {
    return parseInt( num, 10 );
}

var t = parseInt( readline(), 10 );

for ( var i = 0; i < t; i++ ) {
    var line1 = readline().split( ' ' ).map( getInt );
    var line2 = readline();
    var sol = solution(line1[1], line2)
    print( sol );
}
function solution( k, s) {
    s = s.split('');
    var last = s.lastIndexOf('*');
    var first = s.indexOf('*');
    s[first] = 'x';
    s[last] = 'x';

    var prevprev = first;
    var prev;
    var curr;
    for(var i = first + 1; i <= last; i++){
        if(s[i]==='*' || s[i]==='x'){
            s[i] = 'x';
            curr = i;
            if(prev === undefined){
                prev = curr;
                continue;
            }
            if(curr - prevprev <= k){
                s[prev] = '*';
                prev = undefined;
            }
            prevprev = prev || prevprev;
            prev = curr;
        }
    }
    var res = s.filter(function(char){
        return char === 'x';
    }).length;

return res;
}

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let [n, k] = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let arr = readline().trim().split("");
    if (n === 1) {
      console.log(1);
      continue;
    }
    let start = arr.indexOf("*"),
      end = arr.lastIndexOf("*");
    if (end - start + 1 <= 2) {
      console.log(end - start + 1);
      continue;
    }
    let i = start,
      cnt = 0;
    while (i <= end) {
      while (i <= end) {
        if (arr[i] === "*" && arr[i + k] === "*") {
          cnt += 2;
          arr[i] = "X";
          arr[i + k] = "X";
          i = i + k + 1;
          break;
        }
        if (i === start) cnt++;
        i++;
      }
    }
    if (arr[end] === "*") cnt++;
    console.log(cnt);
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}
const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let [n, k] = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let arr = readline().trim().split("");
    if (n === 1) {
      console.log(1);
      continue;
    }
    let cnt = 0,
      i;
    for (i = 0; i < n; i++) {
      if (arr[i] === "*") {
        arr[i] === "X";
        cnt++;
        if (i + k < n && arr[i + k] === "*") {
          arr[i + k] = "X";
          cnt++;
          i = i + k;
        }
        break;
      }
    }
    for (let j = i + 1; j < n; j++) {
      if (j + k < n && arr[j] === "*" && arr[j + k] === "*") {
        arr[j] = "X";
        arr[j + k] = "X";
        cnt += 2;
      }
    }
    if (arr[n - 1] === "*") cnt++;
    console.log(cnt);
  }
};
solve();

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main();
var mod = 998244353n
var maxN = 10e6 + 1

function main() {
  var x = parseInt(readline())
  //
  Array(parseInt(x)).fill(1).map((t, iii) => {
    // var n = parseInt(readline())
    //   var a = new Array(n)
    //   var marked = new Array(n).fill(false)
    //   var found = new Array(n).fill(false)
    var [n, kk] = readline().split(' ').map((x, iii) => {
      return BigInt(x)
    });
    var a = readline().split('').map((x, iii) => {
      return x
    });
    var min = Number.MAX_SAFE_INTEGER

    var copy = a.slice()

    var index1
    var prev
    for (let i = 0; i < n; i++) {
      if (copy[i] === '*') {
        copy[i] = 'x'
        index1 = i
        break
      }
    }
    for (let i = n; i >= 0; i--) {
      if (copy[i] === '*') {
        copy[i] = 'x'
        break
      }
    }

    var count = index1
    for (let i = 0; i < n; i++) {
      index1 = count
      prev = index1
      while (index1 < copy.length && Math.abs(index1 - prev) <= kk) {
        if (copy[index1] === '*') {
          count = index1
        }
        index1++
      }
      copy[count] = 'x'
    }

    var sum = 0
    for (let i = 0; i < copy.length; i++) {
      if (copy[i] === 'x') sum++
    }
    min = Math.min(min, sum)

    //second part

    copy = a.slice()
    for (let i = 0; i < n; i++) {
      if (copy[i] === '*') {
        copy[i] = 'x'
        break
      }
    }
    for (let i = n; i >= 0; i--) {
      if (copy[i] === '*') {
        copy[i] = 'x'
        index1 = i
        break
      }
    }
    for (let i = 0; i < n; i++) {
      index1 = count
      prev = index1
      while (index1 >= 0 && Math.abs(index1 - prev) <= kk) {
        if (copy[index1] === '*') {
          count = index1
        }
        index1--
      }
      if (Math.abs(index1 - prev) > kk) copy[count] = 'x'
    }

    var sum = 0
    for (let i = 0; i < copy.length; i++) {
      if (copy[i] === 'x') sum++
    }
    min = Math.min(min, sum)

    console.log(min)
  })
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main();
var mod = 998244353n
var maxN = 10e6 + 1

function main() {
  var x = parseInt(readline())
  //
  Array(parseInt(x)).fill(1).map((t, iii) => {
    // var n = parseInt(readline())
    //   var a = new Array(n)
    //   var marked = new Array(n).fill(false)
    //   var found = new Array(n).fill(false)
    var [n, kk] = readline().split(' ').map((x, iii) => {
      return BigInt(x)
    });
    var a = readline().split('').map((x, iii) => {
      return x
    });
    var min = Number.MAX_SAFE_INTEGER

    for (let k = 0; k < a.length; k++) {
      var copy = a.slice()
      var index = 0
      for (let i = 0; i < n; i++) {
        if (copy[i] === '*' && i === k) {
          copy[i] = 'x'
          index = i
        }
      }
      var index1
      var count = index
      var prev = index
      for (let i = 0; i < n; i++) {
        index1 = count
        prev = index1
        while (index1 < copy.length && Math.abs(index1 - prev) <= kk) {
          if (copy[index1] === '*') {
            count = index1
          }
          index1++
        }
        copy[count] = 'x'
      }
      var index1
      var count = index
      for (let i = 0; i < n; i++) {
        index1 = count
        prev = index1
        while (index1 >=0 && Math.abs(index1 - prev) <= kk) {
          if (copy[index1] === '*') {
            count = index1
          }
          index1--
        }
        copy[count] = 'x'
      }

      // console.log(copy.join(''))
      var sum =0
      for (let i = 0; i <copy.length; i++) {
        if(copy[i] ==='x') sum++
      }
      min = Math.min(min, sum)
    }

    console.log(min)
  })
}

l=readline;
for (T=+l(); T--; ) {
    I = l().split` `.map(Number);
    n = I[0];
    k = I[1];
    S = [...l()];

    c = d = p = 0;
    first = last = false;
    for(i=0; i < S.length; i++) {
        const s = S[i];
        d++;
        if (s == '*') {
            if (!first) {
                first = true;
                last = true;
                S[i] = 'x';
                c++;
                d = 0;
            } else if (d > k && p > 0) {
                S[p] = 'x';
                i = p;
                last = true;
                p = d = 0;
                c++;
            } else {
                last = false;
                p = i;
            }
        }
    }
    if (!last) {
        S[p] = 'x';
        c++;
    }

    print(c)
}


This problem is same as the previous one, but has larger constraints.It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (do not try this at home). After arriving at the power station, the cats got impressed with a large power transmission system consisting of many chimneys, electric poles, and wires. Since they are cats, they found those things gigantic.At the entrance of the station, there is a map describing the complicated wiring system. Selena is the best at math among three friends. He decided to draw the map on the Cartesian plane. Each pole is now a point at some coordinates $$$(x_i, y_i)$$$. Since every pole is different, all of the points representing these poles are distinct. Also, every two poles are connected with each other by wires. A wire is a straight line on the plane infinite in both directions. If there are more than two poles lying on the same line, they are connected by a single common wire.Selena thinks, that whenever two different electric wires intersect, they may interfere with each other and cause damage. So he wonders, how many pairs are intersecting? Could you help him with this problem?

The first line contains a single integer $$$n$$$ ($$$2 \le n \le 1000$$$) — the number of electric poles. Each of the following $$$n$$$ lines contains two integers $$$x_i$$$, $$$y_i$$$ ($$$-10^4 \le x_i, y_i \le 10^4$$$) — the coordinates of the poles. It is guaranteed that all of these $$$n$$$ points are distinct.

Print a single integer — the number of pairs of wires that are intersecting.

NoteIn the first example:  In the second example:  Note that the three poles $$$(0, 0)$$$, $$$(0, 2)$$$ and $$$(0, 4)$$$ are connected by a single wire.In the third example:

let input = require('fs')
    .readFileSync(0, 'ascii')
    .split('\n')
    .filter(line => !/^\s*$/.test(line))
    .map(l => l.split(' ').map(w => parseInt(w)));

let [n, ...poles] = input;

function c2(n) {
    return n * (n-1) / 2;
}

function gcd(a, b) {
    if (a == 0) {
        return b;
    } else {
        return gcd(b % a, a);
    }
}

let lines = new Set;
let parallels = new Map;

for (i=0; i<n; i++) {
    const [x1, y1] = poles[i];
    for (j=i+1; j<n; j++) {
        const [x2, y2] = poles[j];
        let a = y1 - y2;
        let b = x2 - x1;
        if (a < 0 || (a == 0 && b < 0)) {
            a = -a;
            b = -b;
        }
        const d = gcd(a, b);
        a /= d;
        b /= d;
        const c = a*x1 + b*y1;
        const line = `${a},${b},${c}`;
        const slope = `${a},${b}`;
        if (!lines.has(line))
            parallels.set(slope, (parallels.get(slope) || 0) + 1);
        lines.add(line);
    }
}

let r = c2(lines.size);
for (let x of parallels.values())
    r -= c2(x);
console.log(r);


You are given three points on a plane. You should choose some segments on the plane that are parallel to coordinate axes, so that all three points become connected. The total length of the chosen segments should be the minimal possible.Two points $$$a$$$ and $$$b$$$ are considered connected if there is a sequence of points $$$p_0 = a, p_1, \ldots, p_k = b$$$ such that points $$$p_i$$$ and $$$p_{i+1}$$$ lie on the same segment.

The input consists of three lines describing three points. Each line contains two integers $$$x$$$ and $$$y$$$ separated by a space — the coordinates of the point ($$$-10^9 \le x, y \le 10^9$$$). The points are pairwise distinct.

On the first line output $$$n$$$ — the number of segments, at most 100. The next $$$n$$$ lines should contain descriptions of segments. Output four integers $$$x_1$$$, $$$y_1$$$, $$$x_2$$$, $$$y_2$$$ on a line — the coordinates of the endpoints of the corresponding segment ($$$-10^9 \le x_1, y_1, x_2, y_2 \le 10^9$$$). Each segment should be either horizontal or vertical. It is guaranteed that the solution with the given constraints exists.

NoteThe points and the segments from the example are shown below.

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function f1(a1, a2, a3) {
  return [3, [[...a1, a1[0], a2[1]], [a1[0], a2[1], a3[0], a2[1]], [a3[0], a2[1], ...a3]]];
}

function f2(a1, a2, a3) {
  return [3, [[...a1, a2[0], a1[1]], [a2[0], a1[1], ...a2], [a2[0], a3[1], ...a3]]];
}

function f3(a1, a2, a3) {
  return [3, [[...a1, a3[0], a1[1]], [a2[0], a1[1], ...a2], [a3[0], a1[1], ...a3]]];
}

function solve(a1, a2, a3) {
  [a1, a2, a3] = [a1, a2, a3].sort((a, b) => a[0] - b[0]);

  if (a1[1] <= a2[1]) {
    if (a3[1] >= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      if (a1[1] <= a3[1]) {
        return f2(a1, a2, a3);
      } else {
        return f3(a1, a2, a3);
      }
    }
  } else {
    if (a3[1] <= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      if (a1[1] <= a3[1]) {
        return f3(a1, a2, a3);
      } else {
        return f2(a1, a2, a3);
      }
    }
  }
}

// const inputs = fs.readFileSync(path.join(__dirname, './codeforces.test.txt'), 'utf-8').split('\n')

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split('\n');
void function main() {
  const a1 = inputs[0].trim().split(' ').map(Number);
  const a2 = inputs[1].trim().split(' ').map(Number);
  const a3 = inputs[2].trim().split(' ').map(Number);
  let [num, res] = solve(a1, a2, a3);
  let tmp = [];

  for (let i = 0; i < res.length; i++) {
    if (res[i][0] === res[i][2] && res[i][1] === res[i][3]) {
      num--;
    } else {
      tmp.push(res[i]);
    }
  }

  console.log(`${num}
${tmp.map(s => s.join(' ')).join('\n')}`);
}();

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function f1(a1, a2, a3) {
  return [3, [[...a1, a1[0], a2[1]], [a1[0], a2[1], a3[0], a2[1]], [a3[0], a2[1], ...a3]]];
}

function f2(a1, a2, a3) {
  return [3, [[...a1, a2[0], a1[1]], [a2[0], a1[1], ...a2], [a2[0], a3[1], ...a3]]];
}

function f3(a1, a2, a3) {
  return [3, [[...a1, a3[0], a1[1]], [a2[0], a1[1], ...a2], [a3[0], a1[1], ...a3]]];
}

function solve(a1, a2, a3) {
  [a1, a2, a3] = [a1, a2, a3].sort((a, b) => a[0] - b[0]);

  if (a1[1] <= a2[1]) {
    if (a3[1] >= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  } else {
    if (a3[1] <= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f3(a1, a2, a3);
    }
  }
}

// const inputs = fs.readFileSync(path.join(__dirname, './codeforces.test.txt'), 'utf-8').split('\n')

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split('\n');
void function main() {
  const a1 = inputs[0].trim().split(' ').map(Number);
  const a2 = inputs[1].trim().split(' ').map(Number);
  const a3 = inputs[2].trim().split(' ').map(Number);
  let [num, res] = solve(a1, a2, a3);
  let tmp = [];

  for (let i = 0; i < res.length; i++) {
    if (res[i][0] === res[i][2] && res[i][1] === res[i][3]) {
      num--;
    } else {
      tmp.push(res[i]);
    }
  }

  console.log(`${num}
${tmp.map(s => s.join(' ')).join('\n')}`);
}();

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function f1(a1, a2, a3) {
  return [3, [[...a1, a1[0], a2[1]], [a1[0], a2[1], a3[0], a2[1]], [a3[0], a2[1], ...a3]]];
}

function f2(a1, a2, a3) {
  return [3, [[...a1, a2[0], a1[1]], [a2[0], a1[1], ...a2], [a2[0], a3[1], ...a3]]];
}

function f3(a1, a2, a3) {
  return [3, [[...a1, a3[0], a1[1]], [a2[0], a1[1], ...a2], [a3[0], a1[1], ...a3]]];
}

function solve(a1, a2, a3) {
  [a1, a2, a3] = [a1, a2, a3].sort((a, b) => a[0] - b[0]);

  if (a1[1] <= a2[1]) {
    if (a3[1] >= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  } else {
    if (a3[1] <= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f3(a1, a2, a3);
    }
  }
}

// const inputs = fs.readFileSync(path.join(__dirname, './codeforces.test.txt'), 'utf-8').split('\n')

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split('\n');
void function main() {
  const a1 = inputs[0].split(' ').map(Number);
  const a2 = inputs[1].split(' ').map(Number);
  const a3 = inputs[2].split(' ').map(Number);
  let [num, res] = solve(a1, a2, a3);
  let tmp = [];

  for (let i = 0; i < res.length; i++) {
    if (res[i][0] === res[i][2] && res[i][1] === res[i][3]) {
      num--;
    } else {
      tmp.push(res[i]);
    }
  }

  console.log(`${num}
${tmp.map(s => s.join(' ')).join('\n')}`);
}();

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function f1(a1, a2, a3) {
  return [3, [[...a1, a1[0], a2[1]], [a1[0], a2[1], a3[0], a2[1]], [a3[0], a2[1], ...a3]]];
}

function f2(a1, a2, a3) {
  return [3, [[...a1, a2[0], a1[1]], // [a2[0], a1[1], a2[0], a3[1]],
  // [a2[0], a3[1], ...a2],
  [a2[0], a1[1], ...a2], [a2[0], a3[1], ...a3]]];
}

function solve(a1, a2, a3) {
  [a1, a2, a3] = [a1, a2, a3].sort((a, b) => a[0] - b[0]);

  if (a1[1] <= a2[1]) {
    if (a3[1] >= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  } else {
    if (a3[1] <= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  }
}

// const inputs = fs.readFileSync(path.join(__dirname, './codeforces.test.txt'), 'utf-8').split('\n')

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split('\n');
void function main() {
  const a1 = inputs[0].split(' ').map(Number);
  const a2 = inputs[1].split(' ').map(Number);
  const a3 = inputs[2].split(' ').map(Number);
  let [num, res] = solve(a1, a2, a3);
  let tmp = [];

  for (let i = 0; i < res.length; i++) {
    if (res[i][0] === res[i][2] && res[i][1] === res[i][3]) {
      num--;
    } else {
      tmp.push(res[i]);
    }
  }

  console.log(`${num}
${tmp.map(s => s.join(' ')).join('\n')}`);
}();

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function f1(a1, a2, a3) {
  return [3, [[...a1, a1[0], a2[1]], [a1[0], a2[1], a3[0], a2[1]], [a3[0], a2[1], ...a3]]];
}

function f2(a1, a2, a3) {
  return [4, [[...a1, a2[0], a1[1]], [a2[0], a1[1], a2[0], a3[1]], [a2[0], a3[1], ...a2], [a2[0], a3[1], ...a3]]];
}

function solve(a1, a2, a3) {
  [a1, a2, a3] = [a1, a2, a3].sort((a, b) => a[0] - b[0]);

  if (a1[1] <= a2[1]) {
    if (a3[1] >= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  } else {
    if (a3[1] <= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  }
}

// const inputs = fs.readFileSync(path.join(__dirname, './codeforces.test.txt'), 'utf-8').split('\n')

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split('\n');
void function main() {
  const a1 = inputs[0].split(' ').map(Number);
  const a2 = inputs[1].split(' ').map(Number);
  const a3 = inputs[2].split(' ').map(Number);
  let [num, res] = solve(a1, a2, a3);
  let tmp = [];

  for (let i = 0; i < res.length; i++) {
    if (res[i][0] === res[i][2] && res[i][1] === res[i][3]) {
      num--;
    } else {
      tmp.push(res[i]);
    }
  }

  console.log(`${num}
${tmp.map(s => s.join(' ')).join('\n')}`);
}();

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function f1(a1, a2, a3) {
  return [3, [...a1, a1[0], a2[1]], [a1[0], a2[1], a3[0], a2[1]], [a3[0], a2[1], ...a3]];
}

function f2(a1, a2, a3) {
  return [4, [...a1, a2[0], a1[1]], [a2[0], a1[1], a2[0], a3[1]], [a2[0], a3[1], ...a2], [a2[0], a3[1], ...a3]];
}

function solve(a1, a2, a3) {
  [a1, a2, a3] = [a1, a2, a3].sort((a, b) => a[0] - b[0]);

  if (a1[1] <= a2[1]) {
    if (a3[1] >= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  } else {
    if (a3[1] <= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  }
}

// const inputs = fs.readFileSync(path.join(__dirname, './codeforces.test.txt'), 'utf-8').split('\n')

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split('\n');
void function main() {
  const a1 = inputs[0].split(' ').map(Number);
  const a2 = inputs[1].split(' ').map(Number);
  const a3 = inputs[2].split(' ').map(Number);
  const res = solve(a1, a2, a3);
  console.log(res.map(s => typeof s !== 'number' ? s.join(' ') : s).join('\n'));
}();

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function f1(a1, a2, a3) {
  return [[...a1, a1[0], a2[1]], [a1[0], a2[1], a3[0], a2[1]], [a3[0], a2[1], ...a3]];
}

function f2(a1, a2, a3) {
  return [[...a1, a2[0], a1[1]], [a2[0], a1[1], ...a2], [a2[0], a3[1], ...a3]];
}

function solve(a1, a2, a3) {
  [a1, a2, a3] = [a1, a2, a3].sort((a, b) => a[0] - b[0]);

  if (a1[1] <= a2[1]) {
    if (a3[1] >= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  } else {
    if (a3[1] <= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  }
}

// const inputs = fs.readFileSync(path.join(__dirname, './codeforces.test.txt'), 'utf-8').split('\n')

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split('\n');
void function main() {
  const a1 = inputs[0].split(' ').map(Number);
  const a2 = inputs[1].split(' ').map(Number);
  const a3 = inputs[2].split(' ').map(Number);
  const res = solve(a1, a2, a3);
  console.log(`3
${res.map(s => s.join(' ')).join('\n')}`);
}();

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function f1(a1, a2, a3) {
  return [[...a1, a1[0], a2[1]], [a1[0], a2[1], a3[0], a2[1]], [a3[0], a2[1], ...a3]];
}

function f2(a1, a2, a3) {
  return [[...a1, a2[0], a1[1]], [a2[0], a1[1], ...a2], [a2[0], a3[1], ...a3]];
}

function solve(a1, a2, a3) {
  [a1, a2, a3] = [a1, a2, a3].sort((a, b) => a[0] - b[0]);

  if (a1[1] <= a2[1]) {
    if (a3[1] >= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  } else {
    if (a3[1] <= a2[1]) {
      return f1(a1, a2, a3);
    } else {
      return f2(a1, a2, a3);
    }
  }
}

// const inputs = fs.readFileSync(path.join(__dirname, './codeforces.test.txt'), 'utf-8').split('\n')

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split('\n');
void function main() {
  const a1 = inputs[0].split(' ').map(Number);
  const a2 = inputs[1].split(' ').map(Number);
  const a3 = inputs[2].split(' ').map(Number);
  const res = solve(a1, a2, a3);
  console.log(res.map(s => s.join(' ')).join('\n'));
}();


You are given a huge integer $$$a$$$ consisting of $$$n$$$ digits ($$$n$$$ is between $$$1$$$ and $$$3 \cdot 10^5$$$, inclusive). It may contain leading zeros.You can swap two digits on adjacent (neighboring) positions if the swapping digits are of different parity (that is, they have different remainders when divided by $$$2$$$). For example, if $$$a = 032867235$$$ you can get the following integers in a single operation:   $$$302867235$$$ if you swap the first and the second digits;  $$$023867235$$$ if you swap the second and the third digits;  $$$032876235$$$ if you swap the fifth and the sixth digits;  $$$032862735$$$ if you swap the sixth and the seventh digits;  $$$032867325$$$ if you swap the seventh and the eighth digits. Note, that you can't swap digits on positions $$$2$$$ and $$$4$$$ because the positions are not adjacent. Also, you can't swap digits on positions $$$3$$$ and $$$4$$$ because the digits have the same parity.You can perform any number (possibly, zero) of such operations.Find the minimum integer you can obtain.Note that the resulting integer also may contain leading zeros.

The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases in the input. The only line of each test case contains the integer $$$a$$$, its length $$$n$$$ is between $$$1$$$ and $$$3 \cdot 10^5$$$, inclusive. It is guaranteed that the sum of all values $$$n$$$ does not exceed $$$3 \cdot 10^5$$$.

For each test case print line — the minimum integer you can obtain.

NoteIn the first test case, you can perform the following sequence of operations (the pair of swapped digits is highlighted): $$$0 \underline{\textbf{70}} 9 \rightarrow 0079$$$.In the second test case, the initial integer is optimal. In the third test case you can perform the following sequence of operations: $$$246 \underline{\textbf{43}} 2 \rightarrow 24 \underline{\textbf{63}}42 \rightarrow 2 \underline{\textbf{43}} 642 \rightarrow 234642$$$.

function answer (str) {
    var arr = str.split('');
    var evens = arr.filter(elem => elem % 2 === 0);
    var odds = arr.filter(elem => elem % 2 === 1);
    var i = 0;
    var j = 0;
    var res = [];
    while (i < evens.length && j < odds.length) {
        if (evens[i] < odds[j]) {
            res.push(evens[i]);
            i++;
        } else {
            res.push(odds[j]);
            j++;
        }
    }
    while (i < evens.length) res.push(evens[i++]);
    while (j < odds.length) res.push(odds[j++]);
    return res.join('');
}

var t = parseInt(readline());
var result = '';
for (var i = 0; i < t; i++) {
    var s = readline();
    result += answer(s) + '\n';
}

write(result);

function answer (str) {
    var arr = str.split('');
    for (var j = arr.length - 1; j > 0; j--) {
        for (var i = 1; i < j; i++) {
            var a = arr[i - 1], b = arr[i];
            if ((a % 2 + b % 2) % 2 !== 0 && a > b) {
                var temp = arr[i - 1];
                arr[i - 1] = arr[i];
                arr[i] = temp;
            }
        }
    }
    return arr.join('');
}

var t = parseInt(readline());
var result = '';
for (var i = 0; i < t; i++) {
    var s = readline();
    result += answer(s) + '\n';
}

write(result);

function answer (str) {
    var arr = str.split('');
    var res = arr.sort((a, b) => {
        return (a % 2 + b % 2) % 2 === 0 ? 0 : a - b;
    });
    return res.join('');
}

var t = parseInt(readline());
var result = '';
for (var i = 0; i < t; i++) {
    var s = readline();
    result += answer(s) + '\n';
}

write(result);


There are $$$n$$$ programmers that you want to split into several non-empty teams. The skill of the $$$i$$$-th programmer is $$$a_i$$$. You want to assemble the maximum number of teams from them. There is a restriction for each team: the number of programmers in the team multiplied by the minimum skill among all programmers in the team must be at least $$$x$$$.Each programmer should belong to at most one team. Some programmers may be left without a team.Calculate the maximum number of teams that you can assemble.

The first line contains the integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$x$$$ ($$$1 \le n \le 10^5; 1 \le x \le 10^9$$$) — the number of programmers and the restriction of team skill respectively. The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \dots , a_n$$$ ($$$1 \le a_i \le 10^9$$$), where $$$a_i$$$ is the skill of the $$$i$$$-th programmer. The sum of $$$n$$$ over all inputs does not exceed $$$10^5$$$.

For each test case print one integer — the maximum number of teams that you can assemble.

function solve() {
   var nx = readArray(BigInt);
   var a = readArray(BigInt);
   a.sort(sortF);
   var n = nx[0];
   var x = nx[1];
   var ans = 0;
   var r = n;
   for (var i = n - 1n; i >= 0n; i--) {
      if (a[i] * (r - i) >= x) {
         ans++;
         r = i;
      }
   }
   write(ans);
}
function init() {
   var T;
   T = 1;
   T = Number(read());
   for (var t = 0; t < T; t++) {
      solve();
   }
}

function readArray(mapF) {
   return read().split(' ').map(mapF);
}

function sortF(a, b) {
   if (a < b) {
      return -1;
   }
   if (a > b) {
      return 1;
   }
   return 0;
}

var isNode = typeof console !== 'undefined';
var MEMORY = [];
var MEMORY_INDEX = 0;
if (isNode) {
   var fs = require('fs');
   var path = require('path');

   var inTextName;
   var outTextName;
   if (process.argv.length === 5) {
      inTextName = process.argv[3];
      outTextName = process.argv[4];
   }

   if (inTextName) {
      fs.readFile(path.join(__dirname, inTextName), 'utf8', (err, data) => {
         MEMORY = data.split('\r\n');
         init();
      });
   } else {
      var RL = require('readline').createInterface({
         input : process.stdin,
         output : process.stdout
      });

      RL.on('line', (line) => {
         MEMORY.push(line);
      });

      RL.on('close', init);
   }
} else {
   init();
}

function write(value) {
   isNode ? console.log(value) : print(value);
}
function read() {
   return isNode ? MEMORY[MEMORY_INDEX++] : readline();
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    C();
});

function readline() {
    return inputString[currentLine++];
}

function pi(a) {
    return parseInt(a);
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = pi(a[i]);

    return a;
}

function A(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let n = pi(readline());
        if(n % 2 === 0){
            console.log('YES');
        }else{
            console.log('NO');
        }
    }
}

function C(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let [n,x] = ti(readline().split(' '));
        let a = ti(readline().split(' '));
        let max = 0;
        let dp = new Array(n);
        a.sort((a,b) => a-b)
        for(let i = n-1; i >= 0; i--){
            let m = Math.ceil(x / a[i]);

            if(i+m < n){
                dp[i] = 1 + dp[i+m];
            }else{
                if(i+m-1 < n){
                    dp[i] = 1;
                }else{
                    dp[i] = 0;
                }
            }

            max = Math.max(max, dp[i]);
        }

        //console.log(dp);
        console.log(max);
    }
}

var case_num = parseInt(readline());
for (var i = 0; i < case_num; i += 1) {
  var tmp = readline().split(' ').map((e) => parseInt(e));
  var n = tmp[0], x = tmp[1];
  var nums = readline().split(' ').map((e) => parseInt(e));
  nums.sort((e1, e2) => e1 - e2);
  var cnt = 0, p = n - 1, prev = n;
  while (p >= 0) {
    if ((prev - p) * nums[p] >= x) {
      prev = p;
      cnt += 1;
    }
    p -= 1;
  }
  print(cnt);
}

const case_num = parseInt(readline());
for (var i = 0; i < case_num; i += 1) {
  const tmp = readline().split(' ').map((e) => parseInt(e));
  const n = tmp[0], x = tmp[1];
  const nums = readline().split(' ').map((e) => parseInt(e));
  nums.sort((e1, e2) => e1 - e2);
  var cnt = 0, p = n - 1, prev = n;
  while (p >= 0) {
    if ((prev - p) * nums[p] >= x) {
      prev = p;
      cnt += 1;
    }
    p -= 1;
  }
  print(cnt);
}


Tom loves vowels, and he likes long words with many vowels. His favorite words are vowelly words. We say a word of length $$$k$$$ is vowelly if there are positive integers $$$n$$$ and $$$m$$$ such that $$$n\cdot m = k$$$ and when the word is written by using $$$n$$$ rows and $$$m$$$ columns (the first row is filled first, then the second and so on, with each row filled from left to right), every vowel of the English alphabet appears at least once in every row and every column.You are given an integer $$$k$$$ and you must either print a vowelly word of length $$$k$$$ or print $$$-1$$$ if no such word exists.In this problem the vowels of the English alphabet are 'a', 'e', 'i', 'o' ,'u'.

Input consists of a single line containing the integer $$$k$$$ ($$$1\leq k \leq 10^4$$$) — the required length.

The output must consist of a single line, consisting of a vowelly word of length $$$k$$$ consisting of lowercase English letters if it exists or $$$-1$$$ if it does not. If there are multiple possible words, you may output any of them.

NoteIn the second example, the word "agoeuioaeiruuimaeoieauoweouoiaouimae" can be arranged into the following $$$6 \times 6$$$ grid:  It is easy to verify that every row and every column contain all the vowels.

(function () {
    var read = {
        number: function () {
            return +readline();
        },
        arr: function (divider) {
            return readline().split(divider ? divider : '');
        },
        arrNumber: function (divider) {
            return readline()
                .split(divider ? divider : '')
                .map(item => +item);
        }
    }

    var word = [
        'aeiou',
        'eioua',
        'iouae',
        'ouaei',
        'uaeio',
    ]

    var a = read.number();
    var n = false;
    if(a < 25) {
        print(-1);
        return;
    }

    for(var i = 5; i < a; i++) {
        if(a%i === 0 && a/i >= 5) {
            n = i
            break;
        }
    }

    if(!n) {
        print(-1);
        return;
    }
    else {
        var m = a / n;
        var res = '';
        for(var i =0 ;i < n; i++) {
            res+= word[i % 5];
            for(var j = 5; j < m; j++) {
                res += word[i%5][(j - 5)%5];
            }
        }
        print(res);
    }
}());

var n = +readline();

var mid = Math.floor(Math.pow(n, 0.5))

var low = 0, high = 0;

for(var i = mid; i >= 5; i--) {
    if(n % i === 0) {
        low = i
        high = n / i
    }
}

if(!low) {
    print(-1)
} else {
    // TODO
    var str='aeiou'
    var res =''

    for(var i=0; i< low; i++) {
        for( var j = 0; j< high; j++) {
            res += str[(i+j) % 5]
        }
    }
    print(res)
}

(function () {
    var read = {
        number: function () {
            return +readline();
        },
        arr: function (divider) {
            return readline().split(divider ? divider : '');
        },
        arrNumber: function (divider) {
            return readline()
                .split(divider ? divider : '')
                .map(item => +item);
        }
    }

    var word = [
        'aeiou',
        'eioua',
        'iouae',
        'ouaei',
        'uaeio',
    ]

    var a = read.number();
    var n = false;
    if(a < 25) {
        print(-1);
    }

    for(var i = 5; i < a; i++) {
        if(a%i === 0 && a/i >= 5) {
            n = i
            break;
        }
    }

    if(!n) {
        print(-1);
    }
    else {
        var m = a / n;
        var res = '';
        for(var i =0 ;i < n;i++) {
            res+= word[i % 5];
            for(var j = 5; j < m; j++) {
                res += word[i%5][j - 5];
            }
            res+='\n';
        }
        print(res);
    }
}());

(function () {
    var read = {
        number: function () {
            return +readline();
        },
        arr: function (divider) {
            return readline().split(divider ? divider : '');
        },
        arrNumber: function (divider) {
            return readline()
                .split(divider ? divider : '')
                .map(item => +item);
        }
    }

    var word = [
        'aeiou',
        'eioua',
        'iouae',
        'ouaei',
        'uaeio',
    ]

    var a = read.number();
    var n = false;
    if(a < 25) {
        print(-1);
        return;
    }

    for(var i = 5; i < a; i++) {
        if(a%i === 0 && a/i >= 5) {
            n = i
            break;
        }
    }

    if(!n) {
        print(-1);
        return;
    }
    else {
        var m = a / n;
        var res = '';
        for(var i =0 ;i < n;i++) {
            res+= word[i % 5];
            for(var j = 5; j < m; j++) {
                res += word[i%5][j - 5];
            }
        }
        print(res);
    }
}());

(function () {
    var read = {
        number: function () {
            return +readline();
        },
        arr: function (divider) {
            return readline().split(divider ? divider : '');
        },
        arrNumber: function (divider) {
            return readline()
                .split(divider ? divider : '')
                .map(item => +item);
        }
    }

    var word = [
        'aeiou',
        'eioua',
        'iouae',
        'ouaei',
        'uaeio',
    ]

    var a = read.number();
    var n = false;
    if(a < 25) {
        print(-1);
        return;
    }

    for(var i = 5; i < a; i++) {
        if(a%i === 0 && a/i >= 5) {
            n = i
            break;
        }
    }

    if(!n) {
        print(-1);
        return;
    }
    else {
        var m = a / n;
        var res = '';
        for(var i =0 ;i < n;i++) {
            res+= word[i % 5];
            for(var j = 5; j < m; j++) {
                res += word[i%5][j - 5];
            }
            res+='\n';
        }
        print(res);
    }
}());

(function () {
    var read = {
        number: function () {
            return +readline();
        },
        arr: function (divider) {
            return readline().split(divider ? divider : '');
        },
        arrNumber: function (divider) {
            return readline()
                .split(divider ? divider : '')
                .map(item => +item);
        }
    }

    var a = read.number();
    var n = false;
    for(var i = 2; i < a; i++) {
        if(a%i === 0) {
            n = i
            break;
        }
    }

    if(!n) {
        print(-1);
    }
    else {
        var res = '';
        for(var i =0;i < a;i++) {
            res+='a';
        }
        print(res);
    }

}());


The flag of Berland is such rectangular field n × m that satisfies following conditions:  Flag consists of three colors which correspond to letters 'R', 'G' and 'B'.  Flag consists of three equal in width and height stripes, parralel to each other and to sides of the flag. Each stripe has exactly one color.  Each color should be used in exactly one stripe. You are given a field n × m, consisting of characters 'R', 'G' and 'B'. Output "YES" (without quotes) if this field corresponds to correct flag of Berland. Otherwise, print "NO" (without quotes).

The first line contains two integer numbers n and m (1 ≤ n, m ≤ 100) — the sizes of the field. Each of the following n lines consisting of m characters 'R', 'G' and 'B' — the description of the field.

Print "YES" (without quotes) if the given field corresponds to correct flag of Berland . Otherwise, print "NO" (without quotes).

6 7
RRRGGGG
RRRGGGG
RRRGGGG
RRRBBBB
RRRBBBB
RRRBBBB

NoteThe field in the third example doesn't have three parralel stripes.Rows of the field in the fourth example are parralel to each other and to borders. But they have different heights — 2, 1 and 1.

arr=readline().split(" ").map(x=>x*1);
n=arr[0];
m=arr[1];
grid = [];
for(i=0; i<n; i++) grid.push(readline());
allH = true;
allV = true;
for(i=0; i<n; i++){
    for(j=1; j<m; j++){
        if(grid[i][j]!=grid[i][0]){
            allH = false;
            break;
        }
    }
    if(!allH) break;
}
for(i=0; i<m; i++){
    for(j=1; j<n; j++){
        if(grid[j][i]!=grid[0][i]){
            allV = false;
            break;
        }
    }
    if(!allV) break;
}
isH = false;
isV = false;
if(allH){
    isH = true;
    colors=[];
    hist=[];
    for(i=0; i<n; i++){
        ind = colors.indexOf(grid[i][0]);
        if(ind!=colors.length-1 && ind!=-1){
            isH = false;
            break;
        }else if(ind==-1){
            colors.push(grid[i][0]);
            hist.push(1);
        }else{
            hist[ind]++;
        }
    }
    if(colors.length!=3){
        isH = false;
    }
    for(i=1; i<3; i++){
        if(hist[i]!=hist[i-1]) isH = false;
    }
}
if(allV){
    isV = true;
    colors=[];
    hist=[];
    for(i=0; i<m; i++){
        ind = colors.indexOf(grid[0][i]);
        if(ind!=colors.length-1 && ind!=-1){
            isV = false;
            break;
        }else if(ind==-1){
            colors.push(grid[0][i]);
            hist.push(1);
        }else{
            hist[ind]++;
        }
    }
    if(colors.length!=3){
        isV = false;
    }
    for(i=1; i<3; i++){
        if(hist[i]!=hist[i-1]) isV = false;
    }
}

if(isH || isV) print("YES");
else print("NO");

var n = readline();

n = n.split(" ");
var m = n[1];
n = n[0];
var flag = true;
var s = [];
for (var i = 0; i < n; i++) {
    s.push(readline());
}
if ((n * m % 3) !== 0) { flag = false; } else {
    if (n % 3 === 0) {
        var width = n / 3;
        var tmpl = s[0][0] + s[width][0] + s[width * 2][0];
        if ((tmpl[0] === tmpl[1]) || (tmpl[0] === tmpl[2]) || (tmpl[2] === tmpl[1])) { flag = false; }
        if (((tmpl.indexOf("R") + 1) * (tmpl.indexOf("G") + 1) * (tmpl.indexOf("B") + 1)) === 0) {
            flag = false;
        }

        for (var i = 0; i < width; i++) {
            for (var j = 0; j < m; j++) {
                if (tmpl !== s[i][j] + s[width + i][j] + s[width * 2 + i][j]) {
                    flag = false;
                }

            }
        }
    } else { flag = false; }
    if ((m % 3 === 0) && (!flag)) {
        flag = true;
        width = m / 3;
        tmpl = s[0][0] + s[0][width] + s[0][width * 2];
        if ((tmpl[0] === tmpl[1]) || (tmpl[0] === tmpl[2]) || (tmpl[2] === tmpl[1])) { flag = false; }
        if (((tmpl.indexOf("R") + 1) * (tmpl.indexOf("G") + 1) * (tmpl.indexOf("B") + 1)) === 0) {
            flag = false;
        }
        for (var i = 0; i < width; i++) {
            for (var j = 0; j < n; j++) {
                if (tmpl !== s[j][i] + s[j][width + i] + s[j][width * 2 + i]) {
                    flag = false;
                }
            }
        }
    }

}
if (flag) {
    print("YES")
} else {
    print("NO")
}

arr=readline().split(" ").map(x=>x*1);
n=arr[0];
m=arr[1];
grid = [];
for(i=0; i<n; i++) grid.push(readline());
allH = true;
allV = true;
for(i=0; i<n; i++){
    for(j=1; j<m; j++){
        if(grid[i][j]!=grid[i][0]){
            allH = false;
            break;
        }
    }
    if(!allH) break;
}
for(i=0; i<m; i++){
    for(j=1; j<n; j++){
        if(grid[j][i]!=grid[0][i]){
            allV = false;
            break;
        }
    }
    if(!allV) break;
}
isH = false;
isV = false;
if(allH){
    isH = true;
    colors=[];
    hist=[];
    for(i=0; i<n; i++){
        ind = colors.indexOf(grid[i][0]);
        if(ind!=colors.length-1 && ind!=-1){
            isH = false;
            break;
        }else if(ind==-1){
            colors.push(grid[i][0]);
            hist.push(1);
        }else{
            hist[ind]++;
        }
    }
    if(colors.length!=3){
        isH = false;
    }
    for(i=1; i<3; i++){
        if(hist[i]!=hist[i-1]) isH = false;
    }
}
if(allH){
    isV = true;
    colors=[];
    hist=[];
    for(i=0; i<m; i++){
        ind = colors.indexOf(grid[0][i]);
        if(ind!=colors.length-1 && ind!=-1){
            isV = false;
            break;
        }else if(ind==-1){
            colors.push(grid[0][i]);
            hist.push(1);
        }else{
            hist[ind]++;
        }
    }
    if(colors.length!=3){
        isV = false;
    }
    for(i=1; i<3; i++){
        if(hist[i]!=hist[i-1]) isV = false;
    }
}

if(isH || isV) print("YES");
else print("NO");

arr=readline().split(" ").map(x=>x*1);
n=arr[0];
m=arr[1];
grid = [];
for(i=0; i<n; i++) grid.push(readline());
allH = true;
allV = true;
for(i=0; i<n; i++){
    for(j=1; j<m; j++){
        if(grid[i][j]!=grid[i][0]){
            allH = false;
            break;
        }
    }
    if(!allH) break;
}
for(i=0; i<m; i++){
    for(j=1; j<n; j++){
        if(grid[j][i]!=grid[0][i]){
            allV = false;
            break;
        }
    }
    if(!allV) break;
}
isH = false;
isV = false;
if(allH){
    isH = true;
    colors=[];
    for(i=0; i<n; i++){
        ind = colors.indexOf(grid[i][0]);
        if(ind!=colors.length-1 && ind!=-1){
            isH = false;
            break;
        }else if(ind==-1){
            colors.push(grid[i][0]);
        }
    }
}
if(allV){
    isV = true;
    colors=[];
    for(i=0; i<m; i++){
        ind = colors.indexOf(grid[0][i]);
        if(ind!=colors.length-1 && ind!=-1){
            isV = false;
            break;
        }else if(ind==-1){
            colors.push(grid[0][i]);
        }
    }
}

if(isH || isV) print("YES");
else print("NO");

var n = readline();

n = n.split(" ");
var m = n[1];
n = n[0];
var flag = true;
var s = [];
for (var i = 0; i < n; i++) {
    s.push(readline());
}
if ((n * m % 3) !== 0) { flag = false; } else {
    if (n % 3 === 0) {
        var width = n / 3;
        var tmpl = s[0][0] + s[width][0] + s[width * 2][0];
        if ((tmpl[0] === tmpl[1]) || (tmpl[0] === tmpl[2]) || (tmpl[2] === tmpl[1])) { flag = false; }
        if (((tmpl.indexOf("R") + 1) * (tmpl.indexOf("G") + 1) * (tmpl.indexOf("B") + 1)) === 0) {
            flag = false;
        }

        for (var i = 0; i < width; i++) {
            for (var j = 0; j < m; j++) {
                if (tmpl !== s[i][j] + s[width + i][j] + s[width * 2 + i][j]) {
                    flag = false;
                }

            }
        }
    }
    if ((m % 3 === 0) && (!flag)) {
        width = m / 3;
        tmpl = s[0][0] + s[0][width] + s[0][width * 2];
        if ((tmpl[0] === tmpl[1]) || (tmpl[0] === tmpl[2]) || (tmpl[2] === tmpl[1])) { flag = false; }
        if (((tmpl.indexOf("R") + 1) * (tmpl.indexOf("G") + 1) * (tmpl.indexOf("B") + 1)) === 0) {
            flag = false;
        }
        for (var i = 0; i < width; i++) {
            for (var j = 0; j < n; j++) {
                if (tmpl !== s[j][i] + s[j][width + i] + s[j][width * 2 + i]) {
                    flag = false;
                }
            }
        }
    }

}
if (flag) {
    print("YES")
} else {
    print("NO")
}

var n = readline();

n = n.split(" ");
var m = n[1];
n = n[0];
var flag = true;
var s = [];
for (var i = 0; i < n; i++) {
    s.push(readline());
}
if ((n * m % 3) !== 0) { flag = false; } else {
    if (n % 3 == 0) {
        var width = n / 3;
        var tmpl = s[0][0] + s[width][0] + s[width * 2][0];
        if ((tmpl[0] === tmpl[1]) || (tmpl[0] === tmpl[2]) || (tmpl[2] === tmpl[1])) { flag = false; }
        for (var i = 0; i < width; i++) {
            for (var j = 0; j < m; j++) {
                if (tmpl !== s[i][j] + s[width + i][j] + s[width * 2 + i][j]) {
                    flag = false;
                }

            }
        }
    }
    if ((m % 3 == 0) && (!flag)) {
        width = m / 3;
        tmpl = s[0][0] + s[0][width] + s[0][width * 2];
        if ((tmpl[0] === tmpl[1]) || (tmpl[0] === tmpl[2]) || (tmpl[2] === tmpl[1])) { flag = false; }
        for (var i = 0; i < width; i++) {
            for (var j = 0; j < n; j++) {
                if (tmpl !== s[j][i] + s[j][width + i] + s[j][width * 2 + i]) {
                    flag = false;
                }
            }
        }
    }

}
if (flag) {
    print("YES")
} else {
    print("NO")
}

var n = readline();

n = n.split(" ");
var m = n[1];
n = n[0];
var flag = true;
var s = [];
for (var i = 0; i < n; i++) {
    s.push(readline());
}
if ((n * m % 3) !== 0) { flag = false; } else {
    if (n % 3 == 0) {
        var width = n / 3;
        var tmpl = s[0][0] + s[width][0] + s[width * 2][0];
        for (var i = 0; i < width; i++) {
            for (var j = 0; j < m; j++) {
                if (tmpl !== s[i][j] + s[width + i][j] + s[width * 2 + i][j]) {
                    flag = false;
                }
            }
        }
    }
    if ((m % 3 == 0) && (!flag)) {
        width = m / 3;
        tmpl = s[0][0] + s[0][width] + s[0][width * 2];
        for (var i = 0; i < width; i++) {
            for (var j = 0; j < n; j++) {
                if (tmpl !== s[j][i] + s[j][width + i] + s[j][width * 2 + i]) {
                    flag = false;
                }
            }
        }
    }

}
if (flag) {
    print("YES")
} else {
    print("NO")
}

var n = readline();

n = n.split(" ");
var m = n[1];
n = n[0];
var flag = true;
var s = [];
for (var i = 0; i < n; i++) {
    s.push(readline());
}
if ((n * m % 3) !== 0) { flag = false; } else {
    if (n % 3 === 0) {
        var width = n / 3;
        var tmpl = s[0][0] + s[width][0] + s[width * 2][0];
        if ((tmpl[0] === tmpl[1]) || (tmpl[0] === tmpl[2]) || (tmpl[2] === tmpl[1])) { flag = false; }
        if (((tmpl.indexOf("R") + 1) * (tmpl.indexOf("G") + 1) * (tmpl.indexOf("B") + 1)) === 0) {
            flag = false;
        }

        for (var i = 0; i < width; i++) {
            for (var j = 0; j < m; j++) {
                if (tmpl !== s[i][j] + s[width + i][j] + s[width * 2 + i][j]) {
                    flag = false;
                }

            }
        }
    } else { flag = false; }
    if ((m % 3 === 0) && (!flag)) {
        width = m / 3;
        tmpl = s[0][0] + s[0][width] + s[0][width * 2];
        if ((tmpl[0] === tmpl[1]) || (tmpl[0] === tmpl[2]) || (tmpl[2] === tmpl[1])) { flag = false; }
        if (((tmpl.indexOf("R") + 1) * (tmpl.indexOf("G") + 1) * (tmpl.indexOf("B") + 1)) === 0) {
            flag = false;
        }
        for (var i = 0; i < width; i++) {
            for (var j = 0; j < n; j++) {
                if (tmpl !== s[j][i] + s[j][width + i] + s[j][width * 2 + i]) {
                    flag = false;
                }
            }
        }
    }

}
if (flag) {
    print("YES")
} else {
    print("NO")
}


n soldiers stand in a circle. For each soldier his height ai is known. A reconnaissance unit can be made of such two neighbouring soldiers, whose heights difference is minimal, i.e. |ai - aj| is minimal. So each of them will be less noticeable with the other. Output any pair of soldiers that can form a reconnaissance unit.

The first line contains integer n (2 ≤ n ≤ 100) — amount of soldiers. Then follow the heights of the soldiers in their order in the circle — n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 1000). The soldier heights are given in clockwise or counterclockwise direction.

Output two integers — indexes of neighbouring soldiers, who should form a reconnaissance unit. If there are many optimum solutions, output any of them. Remember, that the soldiers stand in a circle.

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  let len = +readLine();
  const arr = readLine()
    .split(" ")
    .map((n) => parseInt(n));
  let [min, minIndex] = [Math.abs(arr[len - 1] - arr[0]), [len, 1]];

  for (let i = 0; i < len - 1; i++) {
    const diff = Math.abs(arr[i] - arr[i + 1]);
    if (diff < min) {
      min = diff;
      minIndex = [i + 1, i + 2];
    }
  }
  console.log(`${minIndex[0]} ${minIndex[1]}`);
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    return;
  }

  const arr = d.split(' ').map(Number);
  let best = Math.abs(arr[0] - arr[arr.length - 1]);
  let x = 1;
  let y = arr.length;

  for (let i = 0; i < arr.length - 1; i++) {
    const current = Math.abs(arr[i] - arr[i + 1]);

    if (current < best) {
      best = current;
      x = i + 1;
      y = i + 2;
    }
  }

  console.log(x, y);

  c++;
});

let inputString = '';
let currentLine = 0;
process.stdin.on('data', data => {
	inputString += data;
});
process.stdin.on('end', function () {
	inputString = inputString
		.trim()
		.split('\n')
		.map(str => str.trim());
	main();
});

function readLine() {
	return inputString[currentLine++];
}

function multiply(a, b) {
	a = a.toString(10).split('').reverse();
	b = b.toString(10).split('').reverse();

	if (a.length < b.length) {
		[a, b] = [b, a];
	}

	let res = Array(a.length + b.length).fill(0);
	for (let i = 0, lb = b.length; i < lb; ++i) {
		let carry = 0;
		let scarry = 0;
		for (let j = 0, la = a.length; j < la; ++j) {
			let m = b[i] * a[j];
			m += carry;

			if (m > 9) {
				let [c, d] = m.toString(10).split('');
				res[i + j] += (scarry >> 0) + (d >> 0);
				carry = c >> 0;
			} else {
				res[i + j] += (scarry >> 0) + m;
				carry = 0;
			}

			if (res[i + j] > 9) {
				let [c, d] = res[i + j].toString(10).split('');
				res[i + j] = d >> 0;
				scarry = c;
			} else {
				scarry = 0;
			}
		}
		if (carry > 0) res[a.length + i] = carry;
		if (scarry > 0) res[a.length + i] = scarry;
	}

	res.reverse();
	let mulVal = '';
	let flag = false;
	res.forEach(d => {
		if (!flag && d !== 0) flag = true;
		if (flag) mulVal += d;
	});
	return mulVal;
}

function main() {
	let n = readLine() >> 0;
	let h = readLine()
		.split(' ')
		.map(x => x >> 0);
	let d = Math.abs(h[0] - h[n - 1]);
	let x = 1,
		y = n;
	for (let i = 1; i < n; ++i) {
		let diff = Math.abs(h[i] - h[i - 1]);
		if (diff <= d) {
			d = diff;
			x = i;
			y = i + 1;
		}
	}
	console.log(x, y);
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', (inputStd) => {
    inputString += inputStd;
});
process.stdin.on('end', function () {
    inputString = inputString
        .trim()
        .split('\n')
        .map((str) => {
            return str.trim();
        });
    main();
});
function readLine() {
    return inputString[currentLine++];
}
function main() {
    let n = parseInt(readLine());
    let heights = readLine().split(' ').map(Number);
    let differences = Math.min();
    let pairs = [];
    for (let i = 0; i < heights.length; i++) {
        let diff = Math.abs(heights[i] - heights[i + 1]);
        if (diff < differences) {
            differences = diff;
            pairs.push([i + 1, i + 2]);
        }
    }
    if (Math.abs(heights[0] - heights[heights.length - 1]) < differences) {
        console.log(1, heights.length);
        return;
    }
    console.log(...pairs[pairs.length - 1]);
}

const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

var n = -1;
var reconnaissance = [];

rl.on('line', function (input) {

    if (n == -1)
        n = parseInt(input);
    else {
          reconnaissance = input.split(' ').map(item => {return parseInt(item);});
        //****************************************** DO IT HERE*/

        var min = Math.abs(reconnaissance[0] - reconnaissance[reconnaissance.length - 1]);
        var ans = "1 " + reconnaissance.length;

        for(var i = 0; i< n-1; i++)
        {
            var temp = Math.abs(reconnaissance[i] - reconnaissance[i + 1]);
            if (min > temp)
                {
                    min = temp; ans = "" + (i + 1) + " " + (i + 2);
                }

        }
            console.log(ans);

            rl.close();
            /*************************************** */

    }

})

let fs = require("fs");

let txt = fs.readFileSync(0, "utf-8").split(/[\r\n]/).filter(data => data.length > 0);
for (let i = 0; i < txt.length; i += 2) {
    doit(txt[i + 1].split(" ").filter(data => data.length > 0).map(data => data * 1));
}

function doit(tab) {

    let changes = [];
    for (let i = 0; i < tab.length - 1; i++) {
        changes.push(Math.abs(tab[i] - tab[i + 1]));
    }
    changes.push(Math.abs(tab[0] - tab[tab.length - 1]));
    let index = changes.indexOf(Math.min(...changes));
    let next=index+2;
    if(next>tab.length)next-=tab.length;

    console.log(index + 1, next);

}

print(function(n, a) {

	var min = 1e9;
	var ans = [];
	for (var i = 1; i < n; i++) {
		var x = Math.abs(a[i] - a[i - 1]);
		if (x < min) {
			min = x;
			ans[0] = i;
			ans[1] = i + 1;
		}
	}
	var x = Math.abs(a[0] - a[a.length - 1]);
	if (x < min) {
		min = x;
		ans[0] = a.length;
		ans[1] = 1;
	}

	return ans.join(' ');

}(+readline(), readline().split(' ').map(Number)));

;(function () {

	print(function (n, a) {

		var min = Math.abs(a.slice(-1)[0] - a[0]),
			interval = [a.length, 1];

		for (var i = 0, _i = a.length - 1; i < _i && min !== 0; i++) {
			var dif = Math.abs(a[i] - a[i + 1]);
			if (dif < min) {
				min = dif;
				interval = [i + 1, i + 2];
			}
		}

		return interval.join(' ');

	}(+readline(), readline().split(' ').map(Number)));

}.call(this));

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i]);
	};
	return tokens;
}

function main() {
	var n = parseInt(readline());
	var heights = tokenizeIntegers(readline());

	var min = Math.abs(heights[n-1]-heights[0]), minPair = [n-1, 0];
	for (var i = 1; i < n; ++i) {
		var diff = Math.abs(heights[i-1]-heights[i]);
		if (diff < min) {
			min = diff;
			minPair = [i-1, i];
		}
	}

	print((minPair[0]+1)+" "+(minPair[1]+1));
}

main();

'use strict'

let N = +readline()
let lll = readline().split(' ').map(v => parseInt(v))

lll.push(lll[0])

let min = Infinity
let par = 2

for (let i = 1; i < lll.length; i++) {
  let dif = Math.abs(lll[i] - lll[i - 1])
  if (min > dif) {
    min = dif
    par = i
  }

}

print(par + ' ' + (par == lll.length - 1 ? 1 : par + 1))

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    return;
  }

  const arr = d.split(' ').map(Number);
  let best = Infinity;
  let x = Infinity;
  let y = Infinity;

  for (let i = 0; i < arr.length - 1; i++) {
    for (let j = i + 1; j < arr.length; j++) {
      const current = Math.abs(arr[i] - arr[j]);

      if (current < best) {
        best = current;
        x = i + 1;
        y = j + 1;
      }
    }
  }

  console.log(x, y);

  c++;
});

process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', (inputStd) => {
    inputString += inputStd;
});
process.stdin.on('end', function () {
    inputString = inputString
        .trim()
        .split('\n')
        .map((str) => {
            return str.trim();
        });
    main();
});
function readLine() {
    return inputString[currentLine++];
}
function main() {
    let n = parseInt(readLine());
    let heights = readLine().split(' ').map(Number);
    let differences = Math.min();
    let pairs = [];
    for (let i = 0; i < heights.length; i++) {
        let diff = Math.abs(heights[i] - heights[i + 1]);
        if (diff < differences) {
            differences = diff;
            pairs.push([i, i + 1]);
        }
    }
    if (Math.abs(heights[0] - heights[heights.length - 1]) < differences) {
        console.log(1, heights.length);
        return;
    }
    console.log(...pairs[pairs.length - 1]);
}

let fs = require("fs");

let txt = fs.readFileSync(0, "utf-8").split(/[\r\n]/).filter(data => data.length > 0);
for (let i = 0; i < txt.length; i += 2) {
    doit(txt[i + 1].split(" ").filter(data => data.length > 0).map(data => data * 1));
}

function doit(tab) {

    let changes = [];
    for (let i = 0; i < tab.length - 1; i++) {
        changes.push(Math.abs(tab[i] - tab[i + 1]));
    }
    changes.push(Math.abs(tab[0] - tab[tab.length - 1]));
    let index = changes.indexOf(Math.min(...changes));
    console.log(index + 1, (index + 2) % tab.length);

}

;(function () {

	print(function (n, a) {

		var min = 1e10, j;
		a.push(a[0]);

		for (var i = 0, _i = a.length - 1; i < _i; i++) {
			var r = Math.abs(a[i] - a[i + 1]);
			if (min > r) {
				min = r;
				j = i + 1;
			}
		}

		return [j, (j + 1)%(a.length - 1)].join(' ');

	}(+readline(), readline().split(' ').map(Number)));

}.call(this));


Multiset —is a set of numbers in which there can be equal elements, and the order of the numbers does not matter. Two multisets are equal when each value occurs the same number of times. For example, the multisets $$$\{2,2,4\}$$$ and $$$\{2,4,2\}$$$ are equal, but the multisets $$$\{1,2,2\}$$$ and $$$\{1,1,2\}$$$ — are not.You are given two multisets $$$a$$$ and $$$b$$$, each consisting of $$$n$$$ integers.In a single operation, any element of the $$$b$$$ multiset can be doubled or halved (rounded down). In other words, you have one of the following operations available for an element $$$x$$$ of the $$$b$$$ multiset:   replace $$$x$$$ with $$$x \cdot 2$$$,  or replace $$$x$$$ with $$$\lfloor \frac{x}{2} \rfloor$$$ (round down).  Note that you cannot change the elements of the $$$a$$$ multiset.See if you can make the multiset $$$b$$$ become equal to the multiset $$$a$$$ in an arbitrary number of operations (maybe $$$0$$$).For example, if $$$n = 4$$$, $$$a = \{4, 24, 5, 2\}$$$, $$$b = \{4, 1, 6, 11\}$$$, then the answer is yes. We can proceed as follows:   Replace $$$1$$$ with $$$1 \cdot 2 = 2$$$. We get $$$b = \{4, 2, 6, 11\}$$$.  Replace $$$11$$$ with $$$\lfloor \frac{11}{2} \rfloor = 5$$$. We get $$$b = \{4, 2, 6, 5\}$$$.  Replace $$$6$$$ with $$$6 \cdot 2 = 12$$$. We get $$$b = \{4, 2, 12, 5\}$$$.  Replace $$$12$$$ with $$$12 \cdot 2 = 24$$$. We get $$$b = \{4, 2, 24, 5\}$$$.  Got equal multisets $$$a = \{4, 24, 5, 2\}$$$ and $$$b = \{4, 2, 24, 5\}$$$.

The first line of input data contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) —the number of test cases. Each test case consists of three lines. The first line of the test case contains an integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) —the number of elements in the multisets $$$a$$$ and $$$b$$$. The second line gives $$$n$$$ integers: $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_1 \le a_2 \le \dots \le a_n \le 10^9$$$) —the elements of the multiset $$$a$$$. Note that the elements may be equal. The third line contains $$$n$$$ integers: $$$b_1, b_2, \dots, b_n$$$ ($$$1 \le b_1 \le b_2 \le \dots \le b_n \le 10^9$$$) — elements of the multiset $$$b$$$. Note that the elements may be equal. It is guaranteed that the sum of $$$n$$$ values over all test cases does not exceed $$$2 \cdot 10^5$$$.

For each test case, print on a separate line:   YES if you can make the multiset $$$b$$$ become equal to $$$a$$$,  NO otherwise.  You can output YES and NO in any case (for example, strings yEs, yes, Yes and YES will be recognized as positive answer).

NoteThe first example is explained in the statement.In the second example, it is impossible to get the value $$$31$$$ from the numbers of the multiset $$$b$$$ by available operations.In the third example, we can proceed as follows:   Replace $$$2$$$ with $$$2 \cdot 2 = 4$$$. We get $$$b = \{4, 14, 14, 26, 42\}$$$.  Replace $$$14$$$ with $$$\lfloor \frac{14}{2} \rfloor = 7$$$. We get $$$b = \{4, 7, 14, 26, 42\}$$$.  Replace $$$26$$$ with $$$\lfloor \frac{26}{2} \rfloor = 13$$$. We get $$$b = \{4, 7, 14, 13, 42\}$$$.  Replace $$$42$$$ with $$$\lfloor \frac{42}{2} \rfloor = 21$$$. We get $$$b = \{4, 7, 14, 13, 21\}$$$.  Replace $$$21$$$ with $$$\lfloor \frac{21}{2} \rfloor = 10$$$. We get $$$b = \{4, 7, 14, 13, 10\}$$$.  Got equal multisets $$$a = \{4, 7, 10, 13, 14\}$$$ and $$$b = \{4, 7, 14, 13, 10\}$$$.

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        l++
        const sa = lines[l++].trim().split(' ').map(Number)
        const sb = lines[l++].trim().split(' ').map(Number)
        output[i] = solve(sa, sb)
    }
    console.log(output.join('\n'))
// })()
})

function solve(sa, sb) {
    const map = sa.reduce((o, x) => {
        while (!(x & 1)) x >>= 1
        o[x] = (o[x] || 0) + 1
        return o
    }, {})
    sb.sort((a, b) => b - a)
    for (let i = 0; i < sb.length; i++) {
        let x = sb[i]
        while (x > 1 && !map[x]) {
            x = Math.floor(x / 2)
        }
        if (!map[x]) return 'NO'
        map[x]--
    }
    return 'YES'
}

'use strict';

function solve(n, a, b) {
  a = a.map(num => {
    while (!(num & 1)) {
      num = num >> 1;
    }
    return num;
  }).sort((a, b) => b - a);
  b = b.map(num => {
    while (!(num & 1)) {
      num = num >> 1;
    }
    return num;
  }).sort((a, b) => a - b);
  const map = new Map();
  for (let [i, num] of b.entries()) {
    while (num) {
      if (num & 1) {
        if (!map.has(num)) map.set(num, []);
        map.get(num).push(i);
      }
      num >>= 1;
    }
  }
  const vis = new Array(n);
  for (let num of a) {
    if (!map.has(num)) return 'NO';
    const cur = map.get(num);
    while (cur.length && vis[cur[cur.length - 1]]) cur.pop();
    if (!cur.length) return 'NO';
    vis[cur[cur.length - 1]] = 1;
    cur.pop();
  }
  return 'YES';
}

async function main(read) {
  try {
    let t = Number(await read());
    let res = new Array(t);
    for (let i = 0; i < t; i++) {
      const n = Number(await read());
      const a = (await read()).split(' ').map(Number);
      const b = (await read()).split(' ').map(Number);
      res[i] = solve(n, a, b);
    }
    return res.join('\n');
  } catch (error) {
    console.log(error);
  }
}

let inputs,
    str = '';
function read() {
  return inputs.next().value.trim();
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', input => str += input);
process.stdin.on('end', async () => {
  inputs = str.split('\n').values();
  const output = await main(read);
  process.stdout.write(output);
});