All cities of Lineland are located on the Ox coordinate axis. Thus, each city is associated with its position xi — a coordinate on the Ox axis. No two cities are located at a single point.Lineland residents love to send letters to each other. A person may send a letter only if the recipient lives in another city (because if they live in the same city, then it is easier to drop in).Strange but true, the cost of sending the letter is exactly equal to the distance between the sender's city and the recipient's city.For each city calculate two values mini and maxi, where mini is the minimum cost of sending a letter from the i-th city to some other city, and maxi is the the maximum cost of sending a letter from the i-th city to some other city

The first line of the input contains integer n (2 ≤ n ≤ 105) — the number of cities in Lineland. The second line contains the sequence of n distinct integers x1, x2, ..., xn ( - 109 ≤ xi ≤ 109), where xi is the x-coordinate of the i-th city. All the xi's are distinct and follow in ascending order.

Print n lines, the i-th line must contain two integers mini, maxi, separated by a space, where mini is the minimum cost of sending a letter from the i-th city, and maxi is the maximum cost of sending a letter from the i-th city.

'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++];
}

function print(s) {
  process.stdout.write(`${s}`);
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  // input
  const n = +readline();
  const a = readline().split(' ').map(x => parseInt(x));
  for (let i = 0; i < n; i++) {
    let min, max;
    if (i === 0) {
      min = a[i+1] - a[i];
      max = a[n-1] - a[0];
    } else if (i === n - 1) {
      min = a[i] - a[i-1];
      max = a[n-1] - a[0];
    } else {
      min = Math.min(a[i] - a[i-1], a[i+1] - a[i]);
      max = Math.max(a[i] - a[0], a[n-1] - a[i]);
    }
    print(`${min} ${max}\n`);
  }
}

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;
  }

  let ans = "";
  const arr = d.split(" ").map(Number);

  for (let i = 0; i < arr.length; i++) {
    const leftVal = i === 0 ? Infinity : arr[i - 1];
    const rightVal = i === arr.length - 1 ? Infinity : arr[i + 1];
    const minL = Math.abs(arr[i] - leftVal);
    const minR = Math.abs(rightVal - arr[i]);
    const min = Math.min(minL, minR);
    const maxL = Math.abs(arr[i] - arr[0]);
    const maxR = Math.abs(arr[arr.length - 1] - arr[i]);
    const max = Math.max(maxL, maxR);

    ans += `${min} ${max}\n`;
  }

  console.log(ans);

  c++;
});

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

let n
let miasta

rl.question('', (line) => {
  n = parseInt(line)
  rl.question('', (line) => {
    miasta = line.split(' ').map(Number)
    miasta.splice(0,0, Number.NEGATIVE_INFINITY)
    miasta.push(Number.POSITIVE_INFINITY)
    main()
  })
})

function main() {
  for (let i = 1; i<=n; i++) {
    minimum = Math.min(miasta[i]-miasta[i-1], miasta[i+1]-miasta[i])
    maximum = Math.max(miasta[i]-miasta[1], miasta[n]-miasta[i])
    console.log(minimum, maximum)
  }
  rl.close()
}

'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++];
}

function readint() {
    let line = readline().split(' ').map(function(num) {
        return parseInt(num);
    });
    return line;
}

function readfloat() {
    let line = readline().split(' ').map(function(num) {
        return parseFloat(num);
    });
    return line;
}

function print(x) {
    console.log(x);
}

function write(x) {
    process.stdout.write(x);
}
function min(a,b) {
    if(a > b) return b;
    else return a;
}
function min(a,b) {
    if(a > b) return b;
    else return a;
}
function max(a,b) {
    if(a > b) return a;
    else return b;
}
function main() {
    let [n] = readint();
    let x = readint();
    let mn, mx;
    let last = x.length - 1;
    for(let i = 0; i < last + 1; i++) {
        if(i == 0) {
            mn = x[1] - x[0];
            mx = x[last] - x[0];
        }
        else if(i == last) {
            mn = x[last] - x[last - 1];
            mx = x[last] - x[0];
        } else {
            mn = min((x[i] - x[i-1]), (x[i + 1] - x[i]));
            mx = max(x[i] - x[0], x[last] - x[i]);
        }
        write(mn + " " + mx + "\n");
    }
}

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

let n
let cities

rl.question('', (line) => {
  n = parseInt(line)
  rl.question('', (line) => {
    cities = line.split(' ').map(Number)
    cities.splice(0, 0, Number.NEGATIVE_INFINITY)
    cities.push(Number.POSITIVE_INFINITY)
    main()
  })
});

function main() {
  for (let i = 1; i <= n; ++i) {
    minimum = Math.min(cities[i] - cities[i-1], cities[i+1] - cities[i])
    maximum = Math.max(cities[i] - cities[1], cities[n] - cities[i])
    console.log(minimum, maximum)
  }

  rl.close();
}

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
let input = [];
readline.on('line', line => {
  input.push(line);
});
process.stdin.on('end', () => {
let secondLine = input[1].split(' ');
const n = parseInt(input[0], 10);
secondLine = secondLine.map((el) => parseInt(el, 10));

let text = '';
for (let i = 0; i< n; i++) {
  const current = secondLine[i];
  const right = secondLine[i + 1] !== undefined ? Math.abs(current-secondLine[i + 1]) : null;
  const left = secondLine[i - 1] !== undefined ? Math.abs(current-secondLine[i - 1]) : null;
  const minimum = right !== null && left !== null ? Math.min(right, left) : right || left;
  const maximum = Math.max(Math.abs(secondLine[0] - current), Math.abs(secondLine[n-1] - current))
  text += `${minimum} ${maximum}\n`
}
text = text.slice(0, text.length-1)
console.log(text);
});

var n = parseInt(readline());
var input = readline().split(' ').map(x=>parseInt(x));
var x=input[0];
var y=input[n-1];
var mn1 , mn2 , mn;
var mx1 , mx2 , mx ;
for(var i=0;i<n;i++){
    mx1 = Math.abs(input[i]-x);
    mx2 = Math.abs(y-input[i]);
    mx = Math.max(mx1,mx2);

    if(i===0)
        mn = input[1]-x;
    else if(i==n-1)
        mn = y-input[n-2];
    else{
        mn1=input[i+1]-input[i];
        mn2=input[i]-input[i-1];
        mn=Math.min(mn1,mn2);
    }

    print(mn + ' '+mx);
}

    var n   = parseInt(readline()),
        c   = readline().split(' '),
        mini,
        maxi,
        diff;

    for(var i = 0; i < n; i++){

        mini = Infinity,
        maxi = 0;

        if(i === 0){
            mini = Math.abs(c[i] - c[i + 1]);
            maxi = Math.abs(c[i] - c[c.length - 1]);
        }
        else if (i === n - 1){
            mini = Math.abs(c[i] - c[i - 1]);
            maxi = Math.abs(c[i] - c[0]);
        }
        else{
            mini = Math.min(Math.abs(c[i] - c[i - 1]), Math.abs(c[i] - c[i + 1]));
            maxi = Math.max(Math.abs(c[i] - c[0]), Math.abs(c[i] - c[c.length - 1]));
        }
        print(mini, maxi);
    }

const N = 1<<17;
const INF = 2000000007;

var a;
var n;
var ans1, ans2;
var token = [];
var arr = [];

function initializeData() {
  a = new Array(N);
  ans1 = new Array(N);
  ans2 = new Array(N);
}

el = function(val, idx) {
  this.value = val;
  this.idx = idx;
}

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

initializeData();

n = parseInt(readline());

token = readline().split(' ');
for(var i=0;i<n;i++) {
  a[i] = parseInt(token[i]);
  arr.push(new el(a[i],i));
}

arr.sort(compareEl);

for(var i=0;i<n;i++) {
  var idx = arr[i].idx;

  ans1[idx] = INF;

  if(i>0) ans1[idx]=Math.min(ans1[idx],arr[i].value-arr[i-1].value);
  if(i+1<n) ans1[idx]=Math.min(ans1[idx],arr[i+1].value-arr[i].value);

  ans2[idx]=Math.max(arr[n-1].value-arr[i].value,arr[i].value-arr[0].value);
}

for(var i=0;i<n;i++) {
  print(ans1[i] + " " + ans2[i]);
}

function main(n,arr) {

    var min = Infinity;
    var max = -Infinity;

    for(var i = 0 ; i < n ; i++){

        if(i === 0){
          min = Math.abs(arr[i+1] - arr[i]);
          max = Math.abs(arr[n-1] - arr[i]);
        }
        else if(i === n-1){
          min = Math.abs(arr[i - 1] - arr[i]);
          max = Math.abs(arr[0] - arr[i]);
        }
        else{
          min = Math.min(Math.abs(arr[i+1] - arr[i]),Math.abs(arr[i-1]-arr[i]))
          max = Math.max(Math.abs(arr[0] - arr[i]),Math.abs(arr[n-1]-arr[i]));
        }
        print(min + " " + max);
    }

}

var n = parseInt(readline());

var arr = readline().split(" ");
for(var i = 0 ; i < arr.length ; i++)arr[i] = parseInt(arr[i]);

main(n,arr)

var numberOfCities = Number(readline())
  var positions = readline().split(' ').map(Number)

  var prices = []
  var firstPrice = [
    Math.abs(positions[0] - positions[1]),
    Math.abs(positions[0] - positions[positions.length - 1]),
  ]

  prices.push(firstPrice)

  for (var i = 1; i < numberOfCities - 1; i++) {
    var price = [
      Math.min(
        Math.abs(positions[i] - positions[i - 1]),
        Math.abs(positions[i + 1] - positions[i])
      ),
      Math.max(
        Math.abs(positions[i] - positions[0]),
        Math.abs(positions[positions.length - 1] - positions[i])
      )
    ]

    prices.push(price)
  }

  var lastPrice = [
    Math.abs(positions[positions.length - 1] - positions[positions.length - 2]),
    Math.abs(positions[positions.length - 1] - positions[0]),
  ]

  prices.push(lastPrice)

  for (var i = 0; i < prices.length; i++) {
    print(prices[i].join(' '))
  }

var inputLength = readline();
var input =  readline().split(" ").map(x => parseInt(x));
if(inputLength == 1) {
	inputLength = 0;
	console.log(0);
}
var min, max;
for (var i = 0; i < inputLength; i++) {
  var distanceFromLeft = Math.abs(input[i - 1] - input[i]),
    distanceFromRight = Math.abs(input[i + 1] - input[i]),
    distanceFromFirst = Math.abs(input[0] - input[i]),
    distanceFromLast = Math.abs(input[inputLength - 1] - input[i]);
  if ((distanceFromLeft || Infinity) < (distanceFromRight || Infinity)) {
    min = distanceFromLeft;
  } else {
    min = distanceFromRight;
  }
  if ((distanceFromFirst || -Infinity) > (distanceFromLast || -Infinity)) {
    max = distanceFromFirst;
  } else {
    max = distanceFromLast;
  }
  print(min + ' ' + max);
}

var n = readline();
var a = readline().split(" ");
for(i = 0; i < n; i++){
    var min;
    var max;
    if(i == n -1){
        min = Math.abs(a[i] - a[i-1]);
        max = Math.abs(a[i] - a[0]);
        print(min + " " + max + "\n");
        break;
    }
    if(i == 0){
        min = Math.abs(a[i] - a[i+1]);
        max = Math.abs(a[i] - a[n-1]);
    }
    else{
        min = Math.min(Math.abs(a[i] - a[i+1]), Math.abs(a[i] - a[i-1]));
        max = Math.max(Math.abs(a[i] - a[0]), Math.abs(a[i] - a[n-1]));
    }
    print(min + " " + max + "\n");
}

var n = readline(), list = readline().split(' '), max, min
for (var i = 0 ; i < n; i++){
    if (i === 0) {
        min = Math.abs(list[i+1]-list[i])
        max = Math.abs(list[n-1]-list[i])
    }
    else if (i === n-1){
        min = Math.abs(list[i-1]-list[i])
        max = Math.abs(list[0]-list[i])
    }
    else {
        min = Math.min( Math.abs(list[i+1]-list[i]), Math.abs(list[i-1]-list[i]) )
        max = Math.max( Math.abs(list[n-1]-list[i]), Math.abs(list[0]-list[i]))
    }

    print(min + ' ' + max)
}

var n = readline()
var list = readline().split(' ')
for (var i = 0 ; i < n; i++){
    if (i === 0) {
        print(Math.abs(list[i+1]-list[i]) + ' ' + Math.abs(list[n-1]-list[i]))
    }
    else if (i === n-1){
        print(Math.abs(list[i-1]-list[i]) + ' ' + Math.abs(list[0]-list[i]))
    }
    else {
        print( Math.min( Math.abs(list[i+1]-list[i]), Math.abs(list[i-1]-list[i]) ) + ' ' + Math.max( Math.abs(list[n-1]-list[i]), Math.abs(list[0]-list[i])))
    }
}

//int n, *cit;
//	cin >> n;
//	cit = new int[n];
//	for (int i = 0; i < n; i++)
//	{
//		cin >> cit[i];
//	}
//
//	for (int i = 0; i < n; i++)
//	{
//
//		int max = abs(cit[i] - cit[n - 1]) > abs(cit[i] - cit[0]) ? abs(cit[i] - cit[n - 1]) : abs(cit[i] - cit[0]);
//		int min = 0, rgt, lft;
//
//		if (i == 0)
//		{
//			min = abs(cit[i] - cit[i + 1]);
//		}
//		else if (i == n - 1)
//		{
//			min = abs(cit[i] - cit[i - 1]);
//		}
//		else
//		{
//			min = abs(cit[i] - cit[i - 1]) < abs(cit[i] - cit[i + 1]) ? abs(cit[i] - cit[i - 1]) : abs(cit[i] - cit[i + 1]);
//		}
//
//		cout << min << " " << max << endl;
//	}

var n = readline();
n = parseInt(n);
var cits = readline().split(" ").map(function(x){ return parseInt(x); });
for(var i = 0; i < n; i++)
{
   var max = Math.abs(cits[i] - cits[n - 1]) > Math.abs(cits[i] - cits[0]) ? Math.abs(cits[i] - cits[n - 1]) : Math.abs(cits[i] - cits[0]);

    if(i == 0)
    {
       var min = Math.abs(cits[i] - cits[i + 1]);
    }
    else if (i == n - 1)
    {
        min = Math.abs(cits[i] - cits[i - 1]);
    }
    else
    {
        min = Math.abs(cits[i] - cits[i - 1]) < Math.abs(cits[i] - cits[i + 1]) ? Math.abs(cits[i] - cits[i - 1]) : Math.abs(cits[i] - cits[i + 1]);
    }

    print(min + " " + max);
}

var n = readline();
var dis = readline().split(" ");
var max = new Array(2);
var min = [];

for(var i = 0; i < n; i++){
	if(i-1>=0) min.push(parseInt(dis[i]-dis[i-1]));
	if(i+1<=n-1) min.push(parseInt(dis[i+1]-dis[i]));
	max[0] = parseInt(dis[i]-dis[0]);
	max[1] = parseInt(dis[n-1]-dis[i]);
	var s1 = (min.length == 2) ? (min[0] < min[1]) ? min[0] : min[1] : min[0];
	var s2 = (max[0] > max[1]) ? max[0] : max[1];
	print(s1 + " " + s2);
	min = [];
}

function main() {
	n = readline();
	cities = readline().split(" ");

	for (var i = 0; i < n; i++) {
		var min = cities[n-1] - cities[0];
		var max = 0;
				if (max < (cities[i] - cities[0])) {
			max = cities[i] - cities[0];
		}
		if (max < (cities[n-1] - cities[i])) {
			max = cities[n-1] - cities[i];
		}
		if (i > 0 && min > (cities[i] - cities[i-1])) {
			min = cities[i] - cities[i-1];
		}
		if (i+1 < n && min > (cities[i+1] - cities[i])) {
			min = cities[i+1] - cities[i];
		}

		write(min + " " + max + "\n");
	}
}

main();

function main() {
	n = readline();
	cities = readline().split(" ");

	for (var i = 0; i < n; i++) {
		var min = cities[n-1] - cities[0];
		var max = 0;
		if (i > 0 && min > (cities[i] - cities[i-1])) {
			min = cities[i] - cities[i-1];
		}
		if (i+1 < n && min > (cities[i+1] - cities[i])) {
			min = cities[i+1] - cities[i];
		}
		if (max < (cities[i] - cities[0])) {
			max = cities[i] - cities[0];
		}
		if (max < (cities[n-1] - cities[i])) {
			max = cities[n-1] - cities[i];
		}
		print(min + " " + max);
	}
}

main();

function main() {
	n = readline();
	cities = readline().split(" ");

	for (i = 0; i < n; i++) {
		min = cities[n-1] - cities[0];
		max = 0;

		if (i > 0 && min > (cities[i] - cities[i-1])) {
			min = cities[i] - cities[i-1];
		}
		if (i+1 < n && min > (cities[i+1] - cities[i])) {
			min = cities[i+1] - cities[i];
		}

		if (max < (cities[i] - cities[0])) {
			max = cities[i] - cities[0];
		}
		if (max < (cities[n-1] - cities[i])) {
			max = cities[n-1] - cities[i];
		}

		write(min + " " + max + "\n");
	}
}

main();

function main() {
	n = readline();
	cities = readline().split(" ");

	for (var i = 0; i < n; i++) {
		var min = cities[n-1] - cities[0];
		var max = 0;
				if (max < (cities[i] - cities[0])) {
			max = cities[i] - cities[0];
		}
		if (max < (cities[n-1] - cities[i])) {
			max = cities[n-1] - cities[i];
		}
		if (i > 0 && min > (cities[i] - cities[i-1])) {
			min = cities[i] - cities[i-1];
		}
		if (i+1 < n && min > (cities[i+1] - cities[i])) {
			min = cities[i+1] - cities[i];
		}

		print(min + " " + max);
	}
}

main();

function main() {
	n = readline();
	cities = readline().split(" ");

	for (var i = 0; i < n; i++) {
		var min = cities[n-1] - cities[0];
		var max = 0;

		if (i > 0 && min > (cities[i] - cities[i-1])) {
			min = cities[i] - cities[i-1];
		}
		if (i+1 < n && min > (cities[i+1] - cities[i])) {
			min = cities[i+1] - cities[i];
		}

		if (max < (cities[i] - cities[0])) {
			max = cities[i] - cities[0];
		}
		if (max < (cities[n-1] - cities[i])) {
			max = cities[n-1] - cities[i];
		}

		write(min + " " + max + "\n");
	}
}

main();

function main() {
	n = readline();
	cities = readline().split(" ");

	for (var i = 0; i < n; i++) {
		min = cities[n-1] - cities[0];
		max = 0;

		if (i > 0 && min > (cities[i] - cities[i-1])) {
			min = cities[i] - cities[i-1];
		}
		if (i+1 < n && min > (cities[i+1] - cities[i])) {
			min = cities[i+1] - cities[i];
		}

		if (max < (cities[i] - cities[0])) {
			max = cities[i] - cities[0];
		}
		if (max < (cities[n-1] - cities[i])) {
			max = cities[n-1] - cities[i];
		}

		write(min + " " + max + "\n");
	}
}

main();

function main(){

var line1 = readline();
var line2 = readline().split(' ').map(Number);

var n = parseInt(line1);

if(n===2){
    var str = '';

    str += (Math.abs(line2[0]-line2[1]));
    str += ' ';
    str += (Math.abs(line2[0]-line2[1]));

    print(str);
    print(str);

    return;
}

for(i=0;i<n;i++){
    var str = '';
    var min = 2000000000;
    var max = -2000000000;

    if(i!== 0){
	if(Math.abs(line2[i]-line2[i-1])<min){
	    min = Math.abs(line2[i]-line2[i-1]);
	}

	if(Math.abs(line2[i]-line2[0])>max){
	    max = Math.abs(line2[i]-line2[0]);
	}
    }

    if(i!== n-1){
	if(Math.abs(line2[i]-line2[i+1])<min){
	    min = Math.abs(line2[i]-line2[i+1]);
	}

	if(Math.abs(line2[i]-line2[n-1])>max){
	    max = Math.abs(line2[i]-line2[n-1]);
	}
    }

    str += min;
    str += ' ';
    str += max;

    print(str);
}
}
main();

readline()
T=readline().split(' ').map(x=>+x)
a=Math.abs,mi=Math.min,ma=Math.max,M=Number.MAX_VALUE,L=T.length
print(T.map((x,i)=>
  `${mi(i?a(T[i-1]-T[i]):M,(i<L-1)?a(T[i]-T[i+1]):M)} ` +
  `${ma(i?a(T[0]-T[i]):-M,(i<L-1)?a(T[i]-T[L-1]):-M)}`)
  .join('\n'))

readline()
T=readline().split(' ').map(x=>+x)
a=Math.abs,mi=Math.min,ma=Math.max
q=T.map((x,i)=>
  `${mi(i?a(T[i-1]-T[i]):Number.MAX_VALUE,(i<T.length-1)?a(T[i]-T[i+1]):Number.MAX_VALUE)} ` +
  `${ma(i?a(T[0]-T[i]):-Number.MAX_VALUE,(i<T.length-1)?a(T[i]-T[T.length-1]):-Number.MAX_VALUE)}`)
  .join('\n')
print(q)

readline()
T=readline().split(' ').map(x=>+x)
a=Math.abs,mi=Math.min,ma=Math.max,M=Number.MAX_VALUE
print(T.map((x,i)=>
  `${mi(i?a(T[i-1]-T[i]):M,(i<T.length-1)?a(T[i]-T[i+1]):M)} ` +
  `${ma(i?a(T[0]-T[i]):-M,(i<T.length-1)?a(T[i]-T[T.length-1]):-M)}`)
  .join('\n'))

function calculaDistancia(a,b) {
	var moduloA = Math.abs(a);
	var moduloB = Math.abs(b);
	if((a > 0 && b > 0) || (a < 0 && b < 0)) {
		return Math.abs(moduloA - moduloB);
	} else  {
		return Math.abs(moduloA + moduloB);
	}
}

var cidade = readline();
var arrayCidades = readline().split(" ").map(function(x) { return parseInt(x); });

var primeiro = arrayCidades[0];
var ultimo = arrayCidades[arrayCidades.length - 1];
for(var i = 0 ; i < arrayCidades.length ; i ++) {
	var valorCidade = arrayCidades[i];
	var menorDistancia;
    if ( i === 0 ) {
        menorDistancia = calculaDistancia(valorCidade, (arrayCidades.length >= 2 ? arrayCidades[i+1] : valorCidade));
    } else if ( i === arrayCidades.length - 1 ) {
        menorDistancia = calculaDistancia(valorCidade, (arrayCidades.length >= 2 ? arrayCidades[i-1] : valorCidade));
    } else {
    	var distanciaEsquerda = calculaDistancia(valorCidade, arrayCidades[i-1]);
    	var distanciaDireita = calculaDistancia(valorCidade, arrayCidades[i+1]);
    	menorDistancia = distanciaEsquerda > distanciaDireita ? distanciaDireita : distanciaEsquerda;
    }
    var maiorDistanciaEsquerda = calculaDistancia(primeiro, valorCidade);
    var maiorDistanciaDireita = calculaDistancia(ultimo, valorCidade);
    var maiorDistancia = maiorDistanciaEsquerda > maiorDistanciaDireita ? maiorDistanciaEsquerda : maiorDistanciaDireita;
    print(menorDistancia, maiorDistancia);
}

var citiesCount = parseInt(readline());
var places = readline().split(" ").map(Number);

for (var i = 0; i < places.length; i++) {
    var min = 0;
    var max = 0;

    // Min of 2 nearby values
    min = Math.min(
        Math.abs(places[i] - (i === 0 ? Infinity: places[i - 1])),
        Math.abs(places[i] - (i === places.length - 1 ? Infinity: places[i + 1]))
    );

    // Max of first and last value
    max = Math.max(
        Math.abs(places[i] - places[0]),
        Math.abs(places[i] - places[places.length - 1])
    )

    print(`${min} ${max}`);
}

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;
  }

  let ans = "";
  const arr = d.split(" ").map(Number);

  for (let i = 0; i < arr.length; i++) {
    let minL = Math.abs(arr[i] - (arr[i - 1] || Infinity));
    let minR = Math.abs((arr[i + 1] || Infinity) - arr[i]);
    let min = Math.min(minL, minR);
    let maxL = Math.abs(arr[i] - arr[0]);
    let maxR = Math.abs(arr[arr.length - 1] - arr[i]);
    let max = Math.max(maxL, maxR);

    ans += `${min} ${max}\n`;
  }

  console.log(ans);

  c++;
});

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
let input = [];
readline.on('line', line => {
  input.push(line);
});
process.stdin.on('end', () => {
let secondLine = input[1].split(' ');
const n = parseInt(input[0], 10);
secondLine = secondLine.map((el) => parseInt(el, 10));

let text = '';
for (let i = 0; i< n; i++) {
  const current = secondLine[i];
  const right = secondLine[i + 1] ? Math.abs(current-secondLine[i + 1]) : null;
  const left = secondLine[i - 1] ? Math.abs(current-secondLine[i - 1]) : null;
  const minimum = right && left ? Math.min(right, left) : right || left;
  const maximum = Math.max(Math.abs(secondLine[0] - current), Math.abs(secondLine[n-1] - current))
  text += `${minimum} ${maximum}\n`
}
text = text.slice(0, text.length-1)
console.log(text);
});

var n = readline();
var dis = readline().split(" ");
var max = new Array(2);
var min = [];

for(var i = 0; i < 4; i++){
	if(i-1>=0) min.push(parseInt(dis[i]-dis[i-1]));
	if(i+1<=n-1) min.push(parseInt(dis[i+1]-dis[i]));
	max[0] = parseInt(dis[i]-dis[0]);
	max[1] = parseInt(dis[n-1]-dis[i]);
	var s1 = (min.length == 2) ? (min[0] < min[1]) ? min[0] : min[1] : min[0];
	var s2 = (max[0] > max[1]) ? max[0] : max[1];
	print(s1 + " " + s2);
	min = [];
}

function main(){

var line1 = readline();
var line2 = readline().split(' ').map(Number);

var n = parseInt(line1);

if(n===2){
    var str = '';

    str += (Math.abs(line2[0]-line2[1]));
    str += ' ';
    str += (Math.abs(line2[0]-line2[1]));

    print(str);
    print(str);

    return;
}

for(i=0;i<n;i++){
    var str = '';
    var min = 1000000000;
    var max = -1000000000;

    if(i!== 0){
	if(Math.abs(line2[i]-line2[i-1])<min){
	    min = Math.abs(line2[i]-line2[i-1]);
	}

	if(Math.abs(line2[i]-line2[0])>max){
	    max = Math.abs(line2[i]-line2[0]);
	}
    }

    if(i!== n-1){
	if(Math.abs(line2[i]-line2[i+1])<min){
	    min = Math.abs(line2[i]-line2[i+1]);
	}

	if(Math.abs(line2[i]-line2[n-1])>max){
	    max = Math.abs(line2[i]-line2[n-1]);
	}
    }

    str += min;
    str += ' ';
    str += max;

    print(str);
}
}
main();

var line1 = readline();
var line2 = readline().split(' ').map(Number);

var n = parseInt(line1);

for(i=0;i<n;i++){
    var str = '';
    var min = 1000000000;
    var max = -1000000000;

    for(j=0;j<n;j++){

	if(i===j){
	    continue;
	}
	if(Math.abs(line2[i]-line2[j])<min){
	    min = Math.abs(line2[i]-line2[j]);
	}
	if(Math.abs(line2[i]-line2[j])>max){
	    max = Math.abs(line2[i]-line2[j]);
	}
    }

    str += min;
    str += ' ';
    str += max;

    print(str);
}

var citiesCount = parseInt(readline());
var places = readline().split(" ").map(Number);

for (var i = 0; i < places.length; i++) {
    var min = 0;
    var max = 0;

    // Min of 2 nearby values
    min = Math.min(
        Math.abs(places[i] - (places[ i - 1] || -Infinity)),
        Math.abs(places[i] - (places[i + 1] || -Infinity))
    );

    // Max of first and last values
    max = Math.max(
        Math.abs(places[i] - places[0]),
        Math.abs(places[i] - places[places.length - 1])
    )

    print(`${min} ${max}`);
}

var citiesCount = parseInt(readline());
var places = readline().split(" ").map(Number);

for (var i = 0; i < places.length; i++) {
    var min = 0;
    var max = 0;

    // Min of 2 nearby values
    min = Math.min(
        Math.abs(places[i] - (places[ i - 1] || places[i])),
        Math.abs(places[i] - (places[i + 1] || places[i]))
    );

    // Max of first and last values
    max = Math.max(
        Math.abs(places[i] - places[0]),
        Math.abs(places[i] - places[places.length - 1])
    )

    print(`${min} ${max}`);
}

var citiesCount = parseInt(readline());
var places = readline().split(" ").map(Number);

for (var i = 0; i < places.length; i++) {
    var min = 0;
    var max = 0;

    // Min of 2 nearby values
    min = Math.min(
        Math.abs(places[i] - (places[ i - 1] || 0)),
        Math.abs(places[i] - (places[i + 1] || 0))
    );

    // Max of first and last values
    max = Math.max(
        Math.abs(places[i] - places[0]),
        Math.abs(places[i] - places[places.length - 1])
    )

    print(`${min} ${max}`);
}


You're given an array $$$a_1, \ldots, a_n$$$ of $$$n$$$ non-negative integers.Let's call it sharpened if and only if there exists an integer $$$1 \le k \le n$$$ such that $$$a_1 < a_2 < \ldots < a_k$$$ and $$$a_k > a_{k+1} > \ldots > a_n$$$. In particular, any strictly increasing or strictly decreasing array is sharpened. For example:  The arrays $$$[4]$$$, $$$[0, 1]$$$, $$$[12, 10, 8]$$$ and $$$[3, 11, 15, 9, 7, 4]$$$ are sharpened;  The arrays $$$[2, 8, 2, 8, 6, 5]$$$, $$$[0, 1, 1, 0]$$$ and $$$[2, 5, 6, 9, 8, 8]$$$ are not sharpened. You can do the following operation as many times as you want: choose any strictly positive element of the array, and decrease it by one. Formally, you can choose any $$$i$$$ ($$$1 \le i \le n$$$) such that $$$a_i>0$$$ and assign $$$a_i := a_i - 1$$$.Tell if it's possible to make the given array sharpened using some number (possibly zero) of these operations.

The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 15\ 000$$$)  — the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$). The second line of each test case contains a sequence of $$$n$$$ non-negative integers $$$a_1, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$3 \cdot 10^5$$$.

For each test case, output a single line containing "Yes" (without quotes) if it's possible to make the given array sharpened using the described operations, or "No" (without quotes) otherwise.

NoteIn the first and the second test case of the first test, the given array is already sharpened.In the third test case of the first test, we can transform the array into $$$[3, 11, 15, 9, 7, 4]$$$ (decrease the first element $$$97$$$ times and decrease the last element $$$4$$$ times). It is sharpened because $$$3 < 11 < 15$$$ and $$$15 > 9 > 7 > 4$$$.In the fourth test case of the first test, it's impossible to make the given array sharpened.

'use strict';

const { createInterface } = require('readline');

const rl = createInterface({
  input: process.stdin,
  crlfDelay: Infinity
})
const lines = [];
let nextLine = 0;
rl.on('line', (line) => {
  lines.push(line);
});

rl.on('close', () => {
  main();
});

function readline() {
  return lines[nextLine++];
}

function solve(arr) {
  const n = arr.length;
  if (n % 2 === 0) {
    const b = (n/2) - 1;
    if (arr[b] <= b && arr[b+1] <= b) {
      return false;
    }
  }
  for(let i = 0; i < n; i++) {
    if (arr[i] < Math.min(i, n-i-1)) {
      return false;
    }
  }
  return true;
}

function main() {
  const t = parseInt(readline());
  for(let i = 0; i < t; i++) {
    readline();
    const arr = readline().split(' ');
    const res = solve(arr);
    console.log(res ? 'Yes' : 'No');
  }
}

var numRun= readline();

//zeroes are important and the number of units it is away from the end
//012343210 is an ideal array. as long as every digit is greater than the number it is from the end, it is ok
//3210 is ok; 0110 is not ok... need to find this example
//possible arrays could be 012345,543210,0123210
for(var n=0;n<numRun;n++){
    var k=readline();
    var s=readline().split(" ");
    var ans="No";
    if(checkUp(s)){ans="Yes";}
    if(checkDown(s)){ans="Yes";}
    if(checkMidOdd(s)){ans="Yes";}
    if(checkMidEven1(s)){ans="Yes";}
    if(checkMidEven2(s)){ans="Yes";}
    print(ans);
}//num runs

 //check left to right. Right-most can be 0 but then every other needs to be up 1
function checkUp(arr){
    for(var i=0;i<arr.length;i++){
        if(arr[i]>=i){}
        else{return false;}//one index is too low
    }//fpr
    return true;
}//checkUp

//right to left
function checkDown(arr){
    for(var i=0;i<arr.length;i++){
        if(arr[arr.length-1-i]>=i){}
        else{return false;}//one index is too low
    }//fpr
    return true;
}//checkUp

//check if it is a pyramid... highest index is in the middle
function checkMidOdd(arr){
        var mid=Math.floor(arr.length/2);
        for(var i=0;i<=mid;i++){
            if(arr[i]>=i){}
            else{return false;}//one index is too low
        }
        for(var i=0;i<mid;i++){
             if(arr[arr.length-1-i]>=i){}
             else{return false;}//one index is too low
        }
    return true;
}

//check if it is a pyramid... highest index is in the middle
//high point will be arr.length/2-1 (for 4 array, index 1)
function checkMidEven1(arr){
        if(arr.length%2===1){return false;}
        var mid=Math.floor(arr.length/2);
        for(var i=0;i<=mid;i++){
            //print("index: "+i);
            if(arr[i]>=i){}
            else{return false;}//one index is too low
        }
        for(var i=0;i<mid;i++){
            //print("index: "+arr.length-1-i);
             if(arr[arr.length-1-i]>=i){}
             else{return false;}//one index is too low
        }
    return true;
}

function checkMidEven2(arr){
        if(arr.length%2===1){return false;}
        var mid=Math.floor(arr.length/2)-1;
        if(arr[mid]<mid+1){return false;}
        for(var i=0;i<=mid;i++){
            //print("index: "+i);
            if(arr[i]>=i){}
            else{return false;}//one index is too low
        }
        for(var i=0;i<=mid;i++){
            //print(arr.length-1-i);
             if(arr[arr.length-1-i]>=i){}
             else{return false;}//one index is too low
        }
    return true;
}

function main() {
  var testCasesNum = +readline();
  for (var i = 0; i < testCasesNum; i++) {
    var len = +readline();
    var arr = readline()
      .split(" ")
      .map(Number);

    var left = findLeft(arr);
    var right = findRight(arr);
    if (left >= right) {
      print("Yes");
    } else {
      print("No");
    }
  }
}

function findLeft(arr) {
  var left = arr.length;
  for (var j = 0; j < arr.length; j++) {
    if (arr[j] < j) {
      left = j - 1;
      break;
    }
  }
  return left;
}

function findRight(arr) {
  var right = 0;
  for (var k = 0; k < arr.length; k++) {
    if (arr[arr.length - 1 - k] < k) {
      right = arr.length - k;
      break;
    }
  }
  return right;
}

main()

var numRun= readline();

//zeroes are important and the number of units it is away from the end
//012343210 is an ideal array. as long as every digit is greater than the number it is from the end, it is ok
//3210 is ok; 0110 is not ok... need to find this example
//possible arrays could be 012345,543210,0123210
for(var n=0;n<numRun;n++){
    var k=readline();
    var s=readline().split(" ");
    var ans="No";
    if(checkUp(s)){ans="Yes";}
    if(checkDown(s)){ans="Yes";}
    if(checkMidOdd(s)){ans="Yes";}
    if(checkMidEven1(s)){ans="Yes";}
    if(checkMidEven2(s)){ans="Yes";}
    print(ans);
}//num runs

 //check left to right. Right-most can be 0 but then every other needs to be up 1
function checkUp(arr){
    for(var i=0;i<arr.length;i++){
        if(arr[i]>=i){}
        else{return false;}//one index is too low
    }//fpr
    return true;
}//checkUp

//right to left
function checkDown(arr){
    for(var i=0;i<arr.length;i++){
        if(arr[arr.length-1-i]>=i){}
        else{return false;}//one index is too low
    }//fpr
    return true;
}//checkUp

//check if it is a pyramid... highest index is in the middle
function checkMidOdd(arr){
        var mid=Math.floor(arr.length/2);
        for(var i=0;i<=mid;i++){
            if(arr[i]>=i){}
            else{return false;}//one index is too low
        }
        for(var i=0;i<mid;i++){
             if(arr[arr.length-1-i]>=i){}
             else{return false;}//one index is too low
        }
    return true;
}

//check if it is a pyramid... highest index is in the middle
//high point will be arr.length/2-1 (for 4 array, index 1)
function checkMidEven1(arr){
        if(arr.length%2===1){return false;}
        var mid=Math.floor(arr.length/2);
        if(arr[mid]<mid+1){return false;}
        for(var i=0;i<=mid;i++){
            if(arr[i]>=i){}
            else{return false;}//one index is too low
        }
        for(var i=0;i<mid;i++){
             if(arr[arr.length-1-i]>=i){}
             else{return false;}//one index is too low
        }
    return true;
}

function checkMidEven2(arr){
        if(arr.length%2===1){return false;}
        var mid=Math.floor(arr.length/2)-1;
        if(arr[mid]<mid+1){return false;}
        for(var i=0;i<=mid;i++){
            if(arr[i]>=i){}
            else{return false;}//one index is too low
        }
        for(var i=0;i<mid;i++){
             if(arr[arr.length-1-i]>=i){}
             else{return false;}//one index is too low
        }
    return true;
}

var numRun= readline();

//zeroes are important and the number of units it is away from the end
//012343210 is an ideal array. as long as every digit is greater than the number it is from the end, it is ok
//3210 is ok; 0110 is not ok... need to find this example
//possible arrays could be 012345,543210,0123210
for(var n=0;n<numRun;n++){
    var k=readline();
    var s=readline().split(" ");
    var ans="No";
    if(checkUp(s)){ans="Yes";}
    if(checkDown(s)){ans="Yes";}
    if(checkMidOdd(s)){ans="Yes";}
    if(checkMidEven(s)){ans="Yes";}
    print(ans);
}//num runs

 //check left to right. Right-most can be 0 but then every other needs to be up 1
function checkUp(arr){
    for(var i=0;i<arr.length;i++){
        if(arr[i]>=i){}
        else{return false;}//one index is too low
    }//fpr
    return true;
}//checkUp

//right to left
function checkDown(arr){
    for(var i=0;i<arr.length;i++){
        if(arr[arr.length-1-i]>=i){}
        else{return false;}//one index is too low
    }//fpr
    return true;
}//checkUp

//check if it is a pyramid... highest index is in the middle
function checkMidOdd(arr){
        var mid=Math.floor(arr.length/2);
        for(var i=0;i<=mid;i++){
            if(arr[i]>=i){}
            else{return false;}//one index is too low
        }
        for(var i=0;i<mid;i++){
             if(arr[arr.length-1-i]>=i){}
             else{return false;}//one index is too low
        }
    return true;
}

//check if it is a pyramid... highest index is in the middle
//high point will be arr.length/2-1 (for 4 array, index 1)
function checkMidEven(arr){
        if(arr.length%2===1){return false;}
        var mid=Math.floor(arr.length/2);
        if(arr[mid]>=mid&&arr[mid+1]>=mid){return false;}
        for(var i=0;i<=mid;i++){
            if(arr[i]>=i){}
            else{return false;}//one index is too low
        }
        for(var i=0;i<mid;i++){
             if(arr[arr.length-1-i]>=i){}
             else{return false;}//one index is too low
        }
    return true;
}


You have a list of numbers from $$$1$$$ to $$$n$$$ written from left to right on the blackboard.You perform an algorithm consisting of several steps (steps are $$$1$$$-indexed). On the $$$i$$$-th step you wipe the $$$i$$$-th number (considering only remaining numbers). You wipe the whole number (not one digit).  When there are less than $$$i$$$ numbers remaining, you stop your algorithm. Now you wonder: what is the value of the $$$x$$$-th remaining number after the algorithm is stopped?

The first line contains one integer $$$T$$$ ($$$1 \le T \le 100$$$) — the number of queries. The next $$$T$$$ lines contain queries — one per line. All queries are independent. Each line contains two space-separated integers $$$n$$$ and $$$x$$$ ($$$1 \le x < n \le 10^{9}$$$) — the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least $$$x$$$ numbers.

Print $$$T$$$ integers (one per query) — the values of the $$$x$$$-th number after performing the algorithm for the corresponding queries.

var queriesAmount = parseInt(readline())

for (var i = 0; i < queriesAmount; i++) {
  var nAndX = readline().split(' ').map(function(element) {
    return parseInt(element);
  });

  n = nAndX[0];
  x = nAndX[1];

  print(2 * x);
}

"use strict";

var main = function() {
    var T = +rd();
    while (T-->0) {
        var x = rdAr()[1];
        pr(x << 1);
    }
};

var rd = readline;
var wr = write;
var pr = print;
var rdAr = () => rd().split(' ').map(v => +v);
var prAr = (a) => pr(a.join(' '));
var cmpLt = (a, b) => a - b;
var cmpGt = (a, b) => b - a;

main();

//var input = readline()
var t = parseInt(readline());
for(var i=0; i<t; i++) {
    var ar = readline().split(' ').map(x => parseInt(x));
    var a = ar[0], b = ar[1];
    print(b*2)
}

//

var t = Number(readline());
while(t--){
    var w = readline().split(' ').map(x => Number(x));
    print(String(w[1] * 2) + '\n' );
}

var t = Number(readline());
while(t--){
    w = readline().split(' ').map(x => Number(x));
    print(String(w[1] * 2) + '\n' );
    delete w;
}

var t = Number(readline());
while(t--){
    w = readline().split(' ').map(x => Number(x));
    print(String(w[1] * 2) + '\n' );
}

let i = ''
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const { EOL } = require('os')
    let lines = i.split(EOL) /*your input text, split by lines*/
    const t = Number.parseInt(lines[0]);
    curInd = 0;
    for (let i = 0; i < t; ++i) {
        curInd += 1
        let line = lines[curInd].split(" ");
        const n = Number.parseInt(line[0]);
        const x = Number.parseInt(line[1]);
        console.log(x * 2);
    }
})

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n↑入力 ↓出力');
  Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
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';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//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();
  var output = new Array(t);
  for(var i = 0; i < t; i++){
    var tmp = nextIntArray();
    output[i] = tmp[1] * 2;
  }
  myout(myconv(output, 9));
}

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;
  }

  let [n, x] = d.split(' ').map(Number);
  console.log(x*2);

  c++;
});

const readline = require('readline');

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

var T;

rl.on("line", (line) => {
	if (T == null) T = parseInt(line);
	else {
		var x = parseInt(line.split(' ')[1]);
		console.log(x*2);
		T --;
		if (T == 0)
			rl.close();
	}
});


$$$n$$$ distinct integers $$$x_1,x_2,\ldots,x_n$$$ are written on the board. Nezzar can perform the following operation multiple times.  Select two integers $$$x,y$$$ (not necessarily distinct) on the board, and write down $$$2x-y$$$. Note that you don't remove selected numbers. Now, Nezzar wonders if it is possible to have his favorite number $$$k$$$ on the board after applying above operation multiple times.

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases.  The first line of each test case contains two integers $$$n,k$$$ ($$$2 \le n \le 2 \cdot 10^5$$$, $$$-10^{18} \le k \le 10^{18}$$$). The second line of each test case contains $$$n$$$ distinct integers $$$x_1,x_2,\ldots,x_n$$$ ($$$-10^{18} \le x_i \le 10^{18}$$$). It is guaranteed that the sum of $$$n$$$ for all test cases does not exceed $$$2 \cdot 10^5$$$.

For each test case, print "YES" on a single line if it is possible to have $$$k$$$ on the board. Otherwise, print "NO". You can print each letter in any case (upper or lower).

NoteIn the first test case, the number $$$1$$$ is already on the board.In the second test case, Nezzar could perform the following operations to write down $$$k=0$$$ on the board:   Select $$$x=3$$$ and $$$y=2$$$ and write down $$$4$$$ on the board.  Select $$$x=4$$$ and $$$y=7$$$ and write down $$$1$$$ on the board.  Select $$$x=1$$$ and $$$y=2$$$ and write down $$$0$$$ on the board. In the third test case, it is impossible to have the number $$$k = -1$$$ on the board.

'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();

function main() {
  const x = readline();

  // 1 1 7
  // 6 9, 15, 18
  Array(Number(x)).fill(1).map((t, i) => {
    // var [n,k] = Number(readline())
    var [n, k] = readline().split(' ').map((x, i) => {
      return BigInt(x)
    })

    var a = readline().split(' ').map((x, i) => {
      return BigInt(x)
    })
    a = a.sort((a, b) =>{
      if(a<b) return -1
      if(a>b) return 1
    })
    var g = 0n
    for (let j = 1; j < a.length; j++) {
      g = gcd(g, a[j] - a[0])
    }
    // console.log(g)
    // console.log(a)
    console.log(((k - a[0]) % g === 0n) ? 'YES' : 'NO')
    // console.log(gcd(2, -4))
  })
}

function gcd(a, b) {
  if (!b) {
    return a;
  }

  return gcd(b, a % b);
}

'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();

function main() {
  const x = readline();

  // 1 1 7
  // 6 9, 15, 18
  Array(Number(x)).fill(1).map((t, i) => {
    // var [n,k] = Number(readline())
    var [n, k] = readline().split(' ').map((x, i) => {
      return parseInt(x)
    })

    var a = readline().split(' ').map((x, i) => {
      return parseInt(x)
    })
    a = a.sort((a, b) => a - b)
    var g = 0
    for (let j = 1; j < n; j++) {
      g = gcd(g, a[j] - a[0])
    }
    // console.log(g)
    console.log(((k - a[0]) % g === 0) ? 'YES' : 'NO')
    // console.log(gcd(2, -4))
  })
}

function gcd(a, b) {
  if (!b) {
    return a;
  }

  return gcd(b, a % b);
}

'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();

function main() {
  const x = readline();

  // 1 1 7
  // 6 9, 15, 18
  Array(Number(x)).fill(1).map((t, i) => {
    // var [n,k] = Number(readline())
    var [n,k] = readline().split(' ').map((x, i) => {
      return parseInt(x)
    })

    var a = readline().split(' ').map((x, i) => {
      return parseInt(x)
    })
a = a.sort((a,b)=> a-b)
    var g = a[1] - a[0]
    for (let j = 1; j < n; j++) {
      g = gcd(g, a[j] - a[0])
    }
    // console.log(g)
    console.log(((k-a[0]) % g ===0) ? 'YES':'NO')
    // console.log(gcd(2, -4))
  })
}

function gcd(a, b) {
  if (!b) {
    return a;
  }

  return gcd(b, a % b);
}

'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();

function main() {
    const x = readline();
    var answer = []

    // console.log(Number(x))
    // 1 1 7
    // 6 9, 15, 18
    Array(Number(x)).fill(1).map((t, i) => {
        var [n, k] = readline().split(' ').map(x => Number(x));
        var array = readline().split(' ').map(x => Number(x));
        array = array.sort((a,b)=>a-b)
        var answer = false
        var gg = 0
        array.map((x,i)=>{
            if(i ===0 )return
            gg = gcd(gg,x - array[0])
        })
        // console.log(array)
        // console.log(k, gg)
        console.log((k - array[0]) % gg === 0 ? "YES" :'NO')

    })

}

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


Kawashiro Nitori is a girl who loves competitive programming.One day she found a string and an integer. As an advanced problem setter, she quickly thought of a problem.Given a string $$$s$$$ and a parameter $$$k$$$, you need to check if there exist $$$k+1$$$ non-empty strings $$$a_1,a_2...,a_{k+1}$$$, such that $$$$$$s=a_1+a_2+\ldots +a_k+a_{k+1}+R(a_k)+R(a_{k-1})+\ldots+R(a_{1}).$$$$$$ Here $$$+$$$ represents concatenation. We define $$$R(x)$$$ as a reversed string $$$x$$$. For example $$$R(abcd) = dcba$$$. Note that in the formula above the part $$$R(a_{k+1})$$$ is intentionally skipped.

The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1\le t\le 100$$$)  — the number of test cases. The description of the test cases follows. The first line of each test case description contains two integers $$$n$$$, $$$k$$$ ($$$1\le n\le 100$$$, $$$0\le k\le \lfloor \frac{n}{2} \rfloor$$$)  — the length of the string $$$s$$$ and the parameter $$$k$$$. The second line of each test case description contains a single string $$$s$$$ of length $$$n$$$, consisting of lowercase English letters.

For each test case, print "YES" (without quotes), if it is possible to find $$$a_1,a_2,\ldots,a_{k+1}$$$, and "NO" (without quotes) otherwise. You can print letters in any case (upper or lower).

7
5 1
qwqwq
2 1
ab
3 1
ioi
4 2
icpc
22 0
dokidokiliteratureclub
19 8
imteamshanghaialice
6 3
aaaaaa

NoteIn the first test case, one possible solution is $$$a_1=qw$$$ and $$$a_2=q$$$.In the third test case, one possible solution is $$$a_1=i$$$ and $$$a_2=o$$$.In the fifth test case, one possible solution is $$$a_1=dokidokiliteratureclub$$$.

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

const solve = (n, k, s) => {
    if (k * 2 >= n) return pr('NO');
    let left = s.slice(0, k);
    let right = reverse2(s.slice(n - k));
    if (left == right) return pr('YES');
    pr('NO');
};

const reverse2 = (s) => {
    let res = "";
    for (let i = s.length - 1; i >= 0; i--) {
        res += s[i];
    }
    return 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()

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

const solve = (n, k, s) => {
    if (k * 2 >= n) return pr('NO');
    let left = s.substr(0, k);
    let right = reverse2(s.substr(n - k, k));
    if (left == right) return pr('YES');
    pr('NO');
};

const reverse2 = (s) => {
    let res = "";
    for (let i = s.length - 1; i >= 0; i--) {
        res += s[i];
    }
    return 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()

var dataitr;
var stdin_input = "";
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function (input) { stdin_input += input; });
process.stdin.on("end", function () { dataitr = stdin_input.split('\n').values(); main(); });

const rl = () => dataitr.next().value.trim();
const rn = () => Number(rl());
const ra = () => rl().split(' ');
const rna = () => ra().map(x => Number(x));

function main () {
	let T = rn();
	while (T--) {
		const [n, k] = rna();
		const s = rl();

		let ok = 1;
		for (let i = 0; i < k; i++) {
			ok = ok && s[i] == s[n-i-1];
		}

		console.log(ok && 2*k < n ? 'YES' : 'NO');
	}
}

var dataitr;
var stdin_input = "";
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function (input) { stdin_input += input; });
process.stdin.on("end", function () { dataitr = stdin_input.split('\n').values(); main(); });

const rl = () => dataitr.next().value.trim();
const rn = () => Number(rl());
const ra = () => rl().split(' ');
const rna = () => ra().map(x => Number(x));

function main () {
	let T = rn();
	while (T--) {
		const [n, k] = rna();
		const s = rl();

		let cnt = 0;
		for (let i = 0; i < Math.ceil(n/2)-1; i++) {
			if (s[i] == s[n-i-1]) cnt++;
			else break;
		}

		console.log(cnt >= k ? 'YES' : 'NO');
	}
}

'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 = 1000000000n + 7n
var maxN = 1002

function main() {
  const x = readline();

  Array(parseInt(x)).fill(1).map((t, iii) => {
    var [n, k] = readline().split(' ').map((x, iii) => {
      return parseInt(x)
    })
    var a = readline().split('').map((x, iii) => {
      return x
    })

    if (k === 0) return console.log('YES')
    if (n % 2 === 0 && n === k * 2) return console.log('NO')

    var isTrue = true
    // console.log(n, k)
    for (let i = 0; i < k; i++) {
// console.log(a[i], a[n-i-1], n-k+i-1)
      if(a[i] !== a[n-i-1]) isTrue = false
    }
// console.log(isTrue)
console.log(isTrue ? 'YES':'NO')

  })
}

function gcd(a, b) {
  if (!b) {
    return a;
  }

  return gcd(b, a % b);
}

//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 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 = next();
		if(K == 0){
			myout("YES");
			continue;
		}
		var count = 0;
		for(var j = 0; j < K; j++){
			if(s[j] == s[N - 1 - j]){
				count++;
			}else{
				break;
			}
		}
		if(count >= K){
			if(count == K && N / 2 == K && N % 2 == 0){
				myout("NO");
			}else{
				myout("YES");
			}

		}else{
			myout("NO");
		}
	}
}

'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++];
}

function main() {
    var t = parseInt(readline());
    while(t-- > 0) {
        var n, k, s;

        [n, k] = readline().split(" ").map(s => parseInt(s));
        s = readline();

        if (2*k + 1 > s.length)
            console.log("NO");
        else {
            var ans = "YES";

            for (var i = 0; i < s.length/2; i++) {
                if (s[i] != s[s.length - i - 1]) {
                    if (i < k)
                        ans = "NO";
                    break;
                }
            }

            console.log(ans);
        }
    }
}

process.stdin.setEncoding('utf-8')
const readline = require('readline')

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

let count = -1
let inputArr = []

rl.on('line', data => {
    if (count === -1) {
        count = +data * 2
    } else if (count !== 0) {
        inputArr.push(data)
        count--
    }
    // max number 2^(53) - 1 ~~ 10^(15)
    if (count === 0) {
        // inputArr = inputArr.map(i => i.split(' ').map(j => j))
        main()
        process.exit(0)
    }
})

function solve([n, k], str) {
    if (k * 2 === n) return false
    let nstr = str.split('').reverse()
    for (let i = 0; i < k; i++) {
        if (str[i] !== nstr[i]) return false
    }
    return true
}

function main() {
    for (let i = 0; i < inputArr.length; i += 2) {
        let res = solve(inputArr[i].split(' ').map(j => +j), inputArr[i + 1])
        res ? console.log('YES') : console.log('NO')
    }
}

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

var t = parseInt(readline(), 10);
var lines= [];
for(var i = 0; i<t; i++){
    var line1 = readline().split(' ').map(getInt);
    var n = line1[0];
    var k = line1[1];
    cutPolindrom(readline(), k, n);
}

function cutPolindrom(str, k, n){
    var i = 0;
    var j = n - 1;
    while(i < j && str[i] == str[j]){
        i++;
        j--;
    }
    if(i>j){
        i=i-1;
        j=j+1
    }
    print(i >= k? 'YES' : 'NO');
}

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

const solve = (n, k, s) => {
    if (k == 0) return pr('YES');
    for (let i = 0; i < n; i++) {
        let left = reverse2(s.slice(0, i));
        let right = s.slice(i + 1);
        if (left == right) return pr('YES');
    }
    pr('NO');
};

const reverse2 = (s) => {
    let res = "";
    for (let i = s.length - 1; i >= 0; i--) {
        res += s[i];
    }
    return 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()

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

const solve = (n, k, s) => {
    if (k == 0) return pr('YES');
    for (let i = 0; i < n; i++) {
        let left = s.slice(0, i);
        let right = reverse2(s.slice(i + 1));
        if (left == right) return pr('YES');
    }
    pr('NO');
};

const reverse2 = (s) => {
    let res = "";
    for (let i = s.length - 1; i >= 0; i--) {
        res += s[i];
    }
    return 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()

'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 = 1000000000n + 7n
var maxN = 1002

function main() {
  const x = readline();

  Array(parseInt(x)).fill(1).map((t, iii) => {
    var [n, k] = readline().split(' ').map((x, iii) => {
      return parseInt(x)
    })
    var a = readline().split('').map((x, iii) => {
      return x
    })

    if (k === 0) return console.log('YES')
    if (n % 2 === 0 && n === k * 2) return console.log('NO')

    var isTrue = true
    // console.log(n, k)
    for (let i = 0; i < k+1; i++) {
// console.log(a[i], a[n-i-1], n-k+i-1)
      if(a[i] !== a[n-i-1]) isTrue = false
    }
// console.log(isTrue)
console.log(isTrue ? 'YES':'NO')

  })
}

function gcd(a, b) {
  if (!b) {
    return a;
  }

  return gcd(b, a % b);
}

//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 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 = next();
		if(K == 0){
			myout("YES");
			continue;
		}
		var count = 0;
		for(var j = 0; j < K; j++){
			if(s[j] == s[N - 1 - j]){
				count++;
			}else{
				break;
			}
		}
		if(count >= K){
			if(count == K && N % 2 == 0){
				myout("NO");
			}else{
				myout("YES");
			}

		}else{
			myout("NO");
		}
	}
}


Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a trick on Chris.There are exactly s blocks in Chris's set, each block has a unique number from 1 to s. Chris's teacher picks a subset of blocks X and keeps it to himself. He will give them back only if Chris can pick such a non-empty subset Y from the remaining blocks, that the equality holds:  "Are you kidding me?", asks Chris.For example, consider a case where s = 8 and Chris's teacher took the blocks with numbers 1, 4 and 5. One way for Chris to choose a set is to pick the blocks with numbers 3 and 6, see figure. Then the required sums would be equal: (1 - 1) + (4 - 1) + (5 - 1) = (8 - 3) + (8 - 6) = 7.  However, now Chris has exactly s = 106 blocks. Given the set X of blocks his teacher chooses, help Chris to find the required set Y!

The first line of input contains a single integer n (1 ≤ n ≤ 5·105), the number of blocks in the set X. The next line contains n distinct space-separated integers x1, x2, ..., xn (1 ≤ xi ≤ 106), the numbers of the blocks in X. Note: since the size of the input and output could be very large, don't use slow output techniques in your language. For example, do not use input and output streams (cin, cout) in C++.

In the first line of output print a single integer m (1 ≤ m ≤ 106 - n), the number of blocks in the set Y. In the next line output m distinct space-separated integers y1, y2, ..., ym (1 ≤ yi ≤ 106), such that the required equality holds. The sets X and Y should not intersect, i.e. xi ≠ yj for all i, j (1 ≤ i ≤ n; 1 ≤ j ≤ m). It is guaranteed that at least one solution always exists. If there are multiple solutions, output any of them.


InputThe first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane.Each of the next n lines contains two real coordinates xi and yi of the  point, specified with exactly 2 fractional digits. All coordinates are between  - 1000 and 1000, inclusive.OutputOutput a single real number θ — the answer to the problem statement. The absolute or relative error of your answer should be at most 10 - 2.ExamplesInput8-2.14 2.06-1.14 2.04-2.16 1.46-2.14 0.70-1.42 0.40-0.94 -0.48-1.42 -1.28-2.16 -1.62Output5.410Input52.26 1.442.28 0.642.30 -0.301.58 0.663.24 0.66Output5.620Input86.98 2.066.40 1.125.98 0.245.54 -0.607.16 0.307.82 1.248.34 0.248.74 -0.76Output5.480Input510.44 2.0610.90 0.8011.48 -0.4812.06 0.7612.54 2.06Output6.040Input816.94 2.4215.72 2.3814.82 1.5814.88 0.5015.76 -0.1616.86 -0.2017.00 0.8816.40 0.92Output6.040Input720.62 3.0021.06 2.2821.56 1.3621.66 0.5621.64 -0.5222.14 2.3222.62 3.04Output6.720

The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the  point, specified with exactly 2 fractional digits. All coordinates are between  - 1000 and 1000, inclusive.

const n = Number(readline());
var sum = 0;
for (var i = 0; i < n; i++)
  sum += Number(readline().split(" ")[1]);
print(sum / n + 5);

function main()
{
	var n = parseInt(readline()), i;
	var totY = 0, params;
	for(i = 1; i <= n; ++i)
	{
		params = readline().split(' ').map(function(x){return parseFloat(x);});
		totY += params[1];
	}
	write((totY / n + 5).toFixed(3));
}
main();