You are given an array $$$a[0 \dots n-1]$$$ of $$$n$$$ integers. This array is called a "valley" if there exists exactly one subarray $$$a[l \dots r]$$$ such that:  $$$0 \le l \le r \le n-1$$$,  $$$a_l = a_{l+1} = a_{l+2} = \dots = a_r$$$,  $$$l = 0$$$ or $$$a_{l-1} > a_{l}$$$,  $$$r = n-1$$$ or $$$a_r < a_{r+1}$$$. Here are three examples:  The first image shows the array [$$$3, 2, 2, 1, 2, 2, 3$$$], it is a valley because only subarray with indices $$$l=r=3$$$ satisfies the condition.The second image shows the array [$$$1, 1, 1, 2, 3, 3, 4, 5, 6, 6, 6$$$], it is a valley because only subarray with indices $$$l=0, r=2$$$ satisfies the codition.The third image shows the array [$$$1, 2, 3, 4, 3, 2, 1$$$], it is not a valley because two subarrays $$$l=r=0$$$ and $$$l=r=6$$$ that satisfy the condition.You are asked whether the given array is a valley or not.Note that we consider the array to be indexed from $$$0$$$.

The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 2\cdot10^5$$$) — the length of the array. The second line of each test case contains $$$n$$$ integers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) — the elements of the array. It is guaranteed that the sum of $$$n$$$ over all test cases is smaller than $$$2\cdot10^5$$$.

For each test case, output "YES" (without quotes) if the array is a valley, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).

NoteThe first three test cases are explained in the statement.

let buf='';

process.stdin.on('readable', function(){
    let chunk=process.stdin.read();
    if(chunk) buf+=chunk.toString();
})

process.stdin.on('end', function(){
    const {EOL}=require('os');
    let line=buf.split(EOL);
    let t=parseInt(line[0]);
    for(let _=1;_<=t;_++)
    {
        let n=parseInt(line[2*_-1]);
        let a=line[2*_].split(' ').map(x=>{return parseInt(x)});
        let flag=false;
        a.unshift(1e9+10);
        a.push(1e9+10);
        // console.log(a);
        let cnt=0;
        for(let i=1;i<=n;i++)
        {
            let j=i;
            // if(a[i]===a[j])
            // {
                while(a[j]===a[i]&&j<=n) j++;
                j--;
                if(a[i]<a[j+1]&&a[i]<a[i-1])
                {
                    // console.log('i=',i);
                    // flag=true;
                    cnt++;
                }
                i=j;
            // }
        }
        if(cnt===1) console.log("YES");
        else console.log("NO");
    }
})

//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 if(code == 'long'){
			ret[i] = nextLong();
		}else if(code == 'double'){
			ret[i] = nextDouble();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');} function nextLongArray(size){return nextArray(size, 'long');} function nextDoubleArray(size){return nextArray(size, 'double');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);} function nextLong(){return BigInt(next());} function nextDouble(){return parseFloat(next());}
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();
	var alpha = "abcdefghijklmnopqrstuvwxyz";
	while(hasNext()){
		var N = nextInt();
		var list = nextIntArray(N);
		var newlist = [list[0]];
		for(var i = 1; i < N; i++){
			if(newlist[newlist.length - 1] != list[i]){
				newlist.push(list[i]);
			}
		}
		var c = 0;
		for(var i = 1; i < newlist.length - 1; i++){
			if(newlist[i - 1] > newlist[i] && newlist[i] < newlist[i + 1]){
				c++;
			}
		}
		if(newlist.length <= 2){
			c++;
		}else{
			if(newlist[0] < newlist[1]){
				c++;
			}
			if(newlist[newlist.length - 2] > newlist[newlist.length - 1]){
				c++;
			}
		}

		if(c == 1){
			myout("YES");
		}else{
			myout("NO");
		}
	}
}

const fs = require("fs");
const input = fs.readFileSync(0, 'utf8').trim().split('\r\n');
let currentline = 0;
function readline(){
      return input[currentline++];
}
function alph() {
  var f = 'abcdefghijklmnopqrstuvwxyz';
  return f;
}
function Alph() {
  var f = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  return f;
}
function max(x,y) {
  return x >=y ? x : y;
}
function min(x,y) {
  return x <=y ? x : y;
}
function abs(x) {
  return x < 0 ? x*(-1) : x;
}
var T = readline();
var inf = 1000000000000;
for(var tc=1;tc<=T;tc++) {
	var n = readline()-0;
	var a = readline().split(" ").map(w => parseInt(w));
	var ok = 0;
	a[-1] = inf;
	a[n] = inf;
	for(var i=0;i<n;i++) {
		if(a[i] < a[i-1]) {
			var j = i;
			while(j<n && a[i]===a[j]) j++;
			j--;
		    // console.log(i,j)
			if(a[j] < a[j+1]) {
				// console.log(j);
				ok++;
			}
			i = j;
		}
	}
	console.log(ok==1 ? "YES" : "NO")
}

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++) {
        const n = +lines[l++]
        const arr = lines[l++].trim().split(' ').map(Number)
        output[i] = solve(n, arr)
    }
    console.log(output.join('\n'))
// })()
})

function solve(n, arr) {
    let p, l, r, find = 0
    for (let i = 0; i < arr.length; i++) {
        if (arr[i] === p) {
            r = i
        } else {
            l = r = i
        }
        //
        const a = l === 0 || arr[l - 1] > arr[l]
        const b = r === n - 1 || arr[r] < arr[r + 1]
        if (a && b) {
            if (find) {
                return 'NO'
            } else {
                find = 1
            }
        }
        //
        p = arr[i]
    }
    return find ? 'YES' : 'NO'
}

'use strict';

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

let inputString = '';
let currentLine = 0;

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

process.stdin.on('end', function() {
    inputString = inputString.split('\n');

    main();
});

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

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

    return gcd( b , a%b )
}

function main() {

    let t = parseInt(readLine());

    //let mod = 10**9+7
    loopwhile:
    while(t--)
    {
        let n = parseInt(readLine());

        let arr = readLine().trim().split(" ").map(x=>parseInt(x));

        let diff_arr =[]
        let upwards=false
        for(let i=0;i<n-1;++i){

            let cur=(arr[i]-arr[i+1])
            diff_arr+=cur
            if(cur<0)
            {
                upwards=true
            }
            //console.log("i " + i)
            //console.log("upwards " + upwards)
            if(upwards)
            {
                if(cur>0)
                {
                    console.log("no")
                    continue loopwhile
                }
            }

        }
        console.log("yes")
    }
}

var t = +readline();

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

      var nums = [];
    var arr = readline()
    var arr = readline().split(' ').map((t) => +t)

    print(Challenging(arr));

}
function Challenging (jrray){

    var r = jrray.length;

    var f = 1;
    for(var i = 0; i<r-1 && f==1; i++){
        if (jrray[i] < jrray[i+1]){
            f = 0;
            while (jrray[i+1] >= jrray[i] && i < r-1){
                i++;
            }
            if(i == r-1){
                return 'YES';
            }else {
                return 'NO';
            }
        }

    }
    if (f == 1){
        return 'YES';
    }

}


Two people are playing a game with a string $$$s$$$, consisting of lowercase latin letters. On a player's turn, he should choose two consecutive equal letters in the string and delete them. For example, if the string is equal to "xaax" than there is only one possible turn: delete "aa", so the string will become "xx". A player not able to make a turn loses.Your task is to determine which player will win if both play optimally.

The only line contains the string $$$s$$$, consisting of lowercase latin letters ($$$1 \leq |s| \leq 100\,000$$$), where $$$|s|$$$ means the length of a string $$$s$$$.

If the first player wins, print "Yes". If the second player wins, print "No".

NoteIn the first example the first player is unable to make a turn, so he loses.In the second example first player turns the string into "q", then second player is unable to move, so he loses.

const readline = require('readline')

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

rl.on('line', line => {
  const output = solution(line)
  console.log(output)
})

rl.on('close', () => {
  // console.log(input)
})

function solution(line) {
  let input = line.split('')
  let j = 0
  for (let i = 0;i < input.length;i++) {
    if (i < input.length - 1) {
      if (input[i] === input[i+1]) {
        j++
        input.splice(i, 2)
        i = i - 2
        continue
      }
    }
  }
  if (j % 2 === 0) {
    return 'NO'
  }
  return 'YES'
}

var str = '';
var readliner = require('readline');
var rl = readliner.createInterface(process.stdin, process.stdout, null);
rl.on('line', function (cmd) {
                  //console.log('You just typed: '+cmd);
                  str = cmd;
              }).on('close', main);

function main() {
    //console.log('goodbye!');

/*    var mn = 1000000000;
    for (var code=0; code<(1<<9); code++) {
	var cnt_ones = 0;
	for (var j=0; j<9; j++) cnt_ones += (code>>j)&1;
        var x = N;

    }*/

    var ans = [];
    var Q = 0;
    //console.log(str);
    for (var j=0; j<str.length; j++)
        if (ans.length > 0 && ans[ans.length-1] == str[j]) {
			ans.pop();
			Q++;
        }
		else
			ans.push(str[j]);

    //console.log(ans);
    //console.log(Q);

    if (Q % 2 === 1)
    	console.log("Yes");
    else
    	console.log("No");

    //var x = 1.2345678;
    //console.log('x = ',Number(x).toFixed(5));

    process.exit(0);
};

//var lines = data.split(/\r?\n/);

var str = readline()
var winFirst = false;

for(var i=1;i<str.length;i++) {
    if(str[i] == str[i-1]) {
        winFirst = !winFirst;
        str = str.slice(0,i-1) + str.slice(i+1)
        i -= 2;
    }
}
print(winFirst ? 'Yes' : 'No')

function main(str){

    var cnt = 0;
    var stack = [];
    stack.push(str[0]);

    for(var i = 1 ; i < str.length ; i++){
      if(stack.length !== 0 && str[i] === stack[stack.length-1]){
        cnt++;
        stack.pop();
      }
      else{
        stack.push(str[i]);
      }
    }

    cnt % 2 === 0 ? print("NO") : print("YES");
}

var str = readline();

main(str);

var str = readline()
var winFirst = false;

for(var i=1;i<str.length;i++) {
    if(str[i] == str[i-1]) {
        winFirst = !winFirst;
        str = str.slice(0,i-1) + str.slice(i+1)
        i = i - 2;
    }
}
print(winFirst ? 'Yes' : 'No')

var line = readline().split("");
function check() {
    var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

    for (var i = start; i < line.length - 1; i++) {
        if (line[i] === line[i + 1]) {
            return i;
        }
    }
    return false;
}

var index = check();
var count = 0;
while (index !== false) {
    line.splice(index, 2);
    count++;
    if (index > 0) index--;
    index = check(index);
}

write(count % 2 === 1 ? "Yes" : "No");

var line = readline().split('');
var count = 0;
while (1) {
  var length = line.length;
  var c = count;
  for (var i = 0; i < length - 1; i++) {
    if (line[i] === line[i + 1]) {
      line.splice(i, 2)
      count++;
      i-=2;
      length -= 2;
    }
  }
  if (c === count) {
    break;
  }
}

write(count % 2 === 1 ? 'Yes' : 'No')

//var input = readline()
var str = readline()

var ans = [];
    var cnt = 0;
    for (var j=0; j<str.length; j++) {
          if (ans[ans.length-1] == str[j]) {
            //while(s[j] == s[j+1] && s.length > 0) {
                ans.pop();
                //print('pop = '+ ans.join(''));
			    cnt ++;
            }
		    else {
                ans.push(str[j]);
                //print('push = '+ ans.join(''))
            }
}
if(cnt == 0) print('NO')
else {
      print(cnt %2 == 1 ? 'YES' : 'NO')
  }

//

const readline = require('readline')

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

rl.on('line', line => {
  const output = solution(line)
  console.log(output)
})

rl.on('close', () => {
  // console.log(input)
})

function solution(line) {
  let input = line.split('')
  let length = input.length
  for (let i = 0;i < input.length;i++) {
    if (i < input.length - 1) {
      if (input[input.indexOf(input[i])] === input[input.indexOf(input[i + 1])]) {
        input.splice(i, 2)
        i = i - 2
        continue
      }
    }
  }
  console.log(input)
  if (input.length === length || !input.length) {
    return 'NO'
  }
  return 'YEs'
}

var str = readline()
var winFirst = false;

for(var i=1;i<str.length;i++) {
    if(str[i] == str[i-1]) {
        winFirst = !winFirst;
        str = str.slice(0,i-1) + str.slice(i+1)
        --i;
    }
}
print(winFirst ? 'Yes' : 'No')

function ansa(str){

    var t = 0;
    var strans = str;
    var i = 0;
    while(i !== strans.length){
      if(strans[i] === strans[i+1]){
        strans = strans.slice(0,i) + strans.slice(i+2);
      //  console.log(strans);
        t++;
        i = 0;
      }
      else{
        i++;
      }
    }
    t%2 === 0 ? print("No") : print("Yes");
}

var line = readline().split(' ');
// for(var i = 0 ; i < line.length ; i++) line[i] = parseInt(line[i]);
// var line2 = readline().split(' ');
// for(var i = 0 ; i < line2.length ; i++) line2[i] = parseInt(line2[i]);

ansa(line);

function readline() {
  return 'abba'
}

var line = readline().split('');
var count = 0;
while (1) {
  var found = false;
  for (var i = 0; i < line.length - 1; i++) {
    if (line[i] === line[i + 1]) {
      line.splice(i, 2)
      count++;
      found = true;
      break
    }
  }
  if (!found) break;
}

write(count % 2 === 1 ? 'Yes' : 'No')

//var input = readline()
var str = readline()

var cnt = 0
var s = str.split('')
var first = 1

var L = s.length
for(var i=0; i<first; i++) {
    for(var j=0; j<L; j++) {
        if(s[j] == s[j+1]) {
            var ind = s.indexOf(s[j])
            s.splice(ind, 2)
            //first ++
            cnt ++
            //print(s.join(''))
        }
    }
}
if(cnt == 0) print('NO')
else {
    print(cnt % 2 == 1 ? 'YES' : 'NO');
}

//

//var input = readline()
var str = readline()

var cnt = 0
var s = str.split('')
var first = 1

for(var i=0; i<first; i++) {
    for(var j=0; j<s.length; j++) {
        if(s[j] == s[j+1]) {
            var ind = s.indexOf(s[j])
            s.splice(ind, 2)
            first ++
            cnt ++
        }
    }
}
if(cnt == 0) print('NO')
else {
    print(cnt % 2 == 1 ? 'YES' : 'NO');
}

//

//var input = readline()
var str = readline()

var cnt = 0
var s = str.split('')
var first = 1

//for(var i=0; i<first; i++) {
    for(var j=0; j<s.length; j++) {
        while(s[j] ==  s[j+1]){
            //var ind = s.indexOf(s[j])
            s.splice(j, 2)
            //first ++
            cnt ++
            print(s.join(''))
            j--
        }
    }
//}
if(cnt == 0) print('NO')
else {
    print(cnt % 2 == 1 ? 'YES' : 'NO');
}

//


Vanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the street corresponding to the point 0, and its end corresponding to the point l. Then the i-th lantern is at the point ai. The lantern lights all points of the street that are at the distance of at most d from it, where d is some positive number, common for all lanterns. Vanya wonders: what is the minimum light radius d should the lanterns have to light the whole street?

The first line contains two integers n, l (1 ≤ n ≤ 1000, 1 ≤ l ≤ 109) — the number of lanterns and the length of the street respectively.  The next line contains n integers ai (0 ≤ ai ≤ l). Multiple lanterns can be located at the same point. The lanterns may be located at the ends of the street.

Print the minimum light radius d, needed to light the whole street. The answer will be considered correct if its absolute or relative error doesn't exceed 10 - 9.

NoteConsider the second sample. At d = 2 the first lantern will light the segment [0, 4] of the street, and the second lantern will light segment [3, 5]. Thus, the whole street will be lit.

var input = readline().split(" "), n = +input[0], l = +input[1],
a = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1, x;

for(i = 1; i < n; i++){
	x = a[i] - a[i-1];
	max = (x > max) ? x : max;
}

x = Math.max(max/2, Math.max((l - a[n-1]), (a[0] - 0)));

write(x.toFixed(10));

var inp = readline().split(" ").map(function(x){return parseInt(x);});
var n = inp[0];
var l = inp[1];

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

a.sort(function(e,x){return e - x;});
if (a[0] != 0){
	a.unshift(-a[0]);
	n++;
}
if (a[n-1] != l){
	a.push(l + (l-a[n-1]));
	n++;
}
var max = 0;
var dif = max;
for(var i=1; i < n; i++){
	dif =  a[i] - a[i-1];
	if (dif > max) max = dif;
}

print(max/2);

if (undefined == readline) {
	readline = function() {

	}
}

var ints = function() {
	return readline().split(' ').map(function(w) {
		return parseInt(w)
	})
}

var minus = function(a, b) {
    return a - b
}

var numbers = ints()
	n = numbers[0],
	l = numbers[1]
numbers = ints()
numbers.sort(minus)

var k = numbers.length - 1,
	distance = Math.max(2 * numbers[0], 2 * (l - numbers[numbers.length - 1]))

while (k > 0) {
	distance = Math.max(distance, numbers[k] - numbers[k - 1])
	k --
}

print((distance / 2).toFixed(9))

var n, l, max = 0.0;
var input = readline();
n = Number(input.split(" ")[0]);
l = Number(input.split(" ")[1]);

var lanterns = new Array(n);
input = readline();

for (var i = 0; i < lanterns.length; i++) {
  lanterns[i] = Number(input.split(" ")[i]);
}

for (var i = 0; i < lanterns.length - 1; i++) {
  for (var j = i + 1; j < lanterns.length; j++) {
    if (lanterns[i] > lanterns[j]) {
      var tmp = lanterns[i];
      lanterns[i] = lanterns[j];
      lanterns[j] = tmp;
    }
  }
} // sorting

for (var i = 0; i < lanterns.length - 1; i++) {
   var difference = lanterns[i + 1] - lanterns[i];
   if (difference > max) {
     max = difference;
   }
}
max /= 2;
var first = lanterns[0] - 0;
var last = l - lanterns[n - 1];

if (first > max) {
  max = first;
}
if (last > max) {
  max = last;
}

write(max);

var input = readline().trim().split(' ').map((x)=>parseInt(x));
var a = readline().trim().split(' ').map((x)=>parseInt(x));

if(input[0]==1)
    print(Math.max(a[0],input[1]-a[0]));
else{
    a.sort((a,b)=>a-b);

    var b =[];
    for (var i = 0; i < a.length-1; i++) {
    	b.push(a[i+1]-a[i]);
    }

    b.sort((a,b)=>b-a)
    print(Math.max((b[0]*1.0)/2,a[0],input[1]-a[a.length-1]));
}

var s = readline().split(" ");
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(" ").map(Number).sort((a, b) => a-b);

var maxDif = Math.max(s[0] * 2, (l - s[n-1]) * 2);
for(var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i-1]);
}

print(maxDif / 2);

var s = readline().split(' ');
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(' ').map(Number).sort((a, b) => a - b)
var maxDif = Math.max(s[0] * 2, (l - s[n - 1]) * 2);
for (var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i - 1]);
}
print(maxDif / 2);

'use strict'

String.prototype.getNumArray = function () {
  return String(this).split(' ').map(function (value) {
    return parseInt(value);
  });
}

let _arr = readline().getNumArray(),
    n = _arr[0],
    l = _arr[1],
    array = readline().getNumArray(),
    maxDistance = 0;

array.sort(function(a, b) {
  return a - b;
});

for(let i = 1; i < array.length; i++) {
  if(array[i] - array[i - 1] > maxDistance) {
    maxDistance = array[i] - array[i - 1];
  }
}

if (array[0] > maxDistance / 2 || l - array[array.length - 1] > maxDistance / 2) {
  if(array[0] > l - array[array.length - 1]) {
    maxDistance = array[0];
  } else {
    maxDistance = l - array[array.length - 1];
  }
} else {
  maxDistance = maxDistance / 2;
}
write(maxDistance);

var f = readline().split(" ");
var str = readline().split(" ").sort((x,y)=>x-y);
var res = Math.max(+str[0] * 2, (+f[1] - str[+f[0]-1]) * 2);
	for (var i=0; i<+f[0]; i++){
			if (Number(str[i+1])-Number(str[i])>res)
				res = +str[i+1]-Number(str[i]);

	}
	print(res/2);

var main = function(nPositions, l)
{
	var max = 0;
	var increase = function(a, b)
	{
		return +a - +b;
	}
	var toAnArray = function(str)
	{
		str = str.split(' ');
		return str;
	}
	nPositions = toAnArray(nPositions);
	nPositions.sort(increase);
	for (var i = 1; i <= nPositions.length - 1; i++)
	{
		if (+nPositions[i] - +nPositions[i - 1] > max) max = +nPositions[i] - +nPositions[i - 1];
	}
    if (((+nPositions[0] > max / 2) && (l - +nPositions[nPositions.length - 1] > max / 2)) && (+nPositions[0] > l - +nPositions[nPositions.length - 1] ) )return +nPositions[0];
		else if (((+nPositions[0] > max / 2) && (l - +nPositions[nPositions.length - 1] > max / 2)) && (+nPositions[0] < l - +nPositions[nPositions.length - 1] ) )return l - +nPositions[nPositions.length - 1];
		else if (+nPositions[0] > max / 2) return +nPositions[0];
		else if (l - +nPositions[nPositions.length - 1] > max / 2) return l - +nPositions[nPositions.length - 1];
		else return max / 2;

}

{
	var lAndN = readline(),
	nPositions = readline();
	lAndN = lAndN.split(' ');
	print(main(nPositions, +lAndN[1]));
}

var inp = readline().split(' ');
var a = readline().split(' ');

for(var i=0; i<inp.length; i++) {
    inp[i] = parseInt(inp[i], 10);
}
var n = inp[0], m = inp[1];

for(var i=0; i<a.length; i++) {
    a[i] = parseInt(a[i], 10);
}

a.sort((a,b) => a-b);

var max_d = -Infinity;

if(a[0] !== 0) max_d = a[0];
if(a[n-1] !== m && m - a[n-1] > max_d) max_d = m - a[n-1];

for(var i=0; i<a.length; i++) {
    if((a[i] - a[i-1])/2 > max_d) max_d = (a[i] - a[i-1])/2;
}

print(max_d);

(function main() {
    var line = readline().split(" "),
        n = line[0],
        l = line[1],
        aStrings = readline().split(" "),
        a = [],
        d,
        i;

    for (i in aStrings) {
        a[i] = +aStrings[i];
    }

    a.sort(function(a, b) {
        return a - b;
    });

    d = Math.max(a[0], l - a[a.length - 1]);

    for (i = 1; i < a.length; i++) {
        d = Math.max(d, (a[i] - a[i-1]) / 2);
    }

    print(d.toFixed(10));
})();

var n = readline().split(' ');

var l = n[1];
n = n[0];

var a = readline().split(' ');
for (var i = 0; i < n; i++) {
    a[i] = parseInt(a[i])
}
a.sort(function (a, b) { return a - b });
var ans = Math.max(a[0], l - a[n - 1]);

for (var i = 0; i < n - 1; i++) {
    if ((a[i + 1] - a[i]) / 2 > ans) {
        ans = (a[i + 1] - a[i]) / 2;
    }
}

write(ans)
// console.log(l)

var nums = readNums();

var n = nums[0];
var l = nums[1];

var lanterns = readNums();
lanterns.sort(function(a,b){return b-a});

var k = 0;

for (var i = 0; i<n ;i++) {
    var h = lanterns[i]-lanterns[i+1];
    if (h>k) {
        k = h;
    }
}

var r = k/2;

if (lanterns[n-1] > r) {
    r = lanterns[n-1];
}

if ((l-lanterns[0]) > r) {
    r = l-lanterns[0];
}

print(r);

function readNums() {
    return readline().split(' ').map(function(v) {
        return v - 0;
    })
}

'use strict';

// const rlLib = require('readline');

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

// let inputs = [];
// let allCount = 2;
// let currentLine = 0;

// rl.on('line', (input) => {
// 	inputs.push(input);
// 	if (inputs.length === allCount) {
// 		main();

// 		rl.close();
// 	}
// });

// function readline() {
// 	return inputs[currentLine++];
// }
// function print() {
// 	console.log.apply(this, arguments);
// }

// function main() {
	let rl = readline().split(' ').map(function(e) {return parseInt(e);});
	let f = readline().split(' ').map(function(e) {return parseInt(e, 10);});

	f = f.sort(function(a, b) {return a - b;});

	let res = f[0] * 2;

	if (f[f.length - 1] < rl[1]) {
		let r = (rl[1] - f[f.length - 1])*2;
		res = res > r ? res : r;
	}

	f.forEach(function(e, i) {
		if (i+1 < f.length && (f[i+1] - f[i]) > res) {
			res = f[i+1] - f[i];
		}
	});

	print(res / 2);
// }

"use strict";

var input = readline().split(' ').map(value => +value);
var n = input[0];
var l = 2 * input[1];
var a = readline().split(' ').map(value => 2 * value).sort((a, b) => a - b);

var f = function (x) {
    var right = 0;

    for (let i = 0; i < n; ++i) {
        if (right < a[i] - x) {
            return false;
        }

        right = a[i] + x;
    }

    return right >= l;
};

var left = 0;
var right = l;

while (right - left > 1) {
    var m = Math.floor((left + right) / 2);

    if (f(m)) {
        right = m;
    } else {
        left = m;
    }
}

write(right / 2);

X=readline().split(' ').map(Number)
n=X[0],l=X[1]
A=readline().split(' ').map(Number)
A=A.sort((x,y)=>x-y).reduce((a,c)=>a.length?(a[a.length-1]!=c?a.concat(c):a):[c],[])

A=A.map((x,i) =>
    Math.max(i==0 ? x : (A[i-1]-x)/2, (i==A.length-1) ? l-x : (A[i+1]-x)/2))

print(Math.max.apply(null, A))

function main() {
  var counters = readline().trim().split(' ').map(string => parseInt(string, 10));
  var lanternsCount = counters[0];
  var streetLength = counters[1];
  var lanternsLocation = readline().trim().split(' ').map(string => parseInt(string));

  lanternsLocation = lanternsLocation.sort((a, b) => a - b);

  var min_radius = 0.0000000000;
  for (var index = 0; index < lanternsLocation.length - 1; index++) {
    var curr_radius = (lanternsLocation[index + 1] - lanternsLocation[index]) / 2.0000000000;
    min_radius = Math.max(min_radius, curr_radius);
  }

  if (!lanternsLocation.includes(0)) {
    min_radius = Math.max(min_radius, lanternsLocation[0]);
  }

  if (!lanternsLocation.includes(streetLength)) {
    min_radius = Math.max(min_radius, streetLength - lanternsLocation[lanternsLocation.length - 1]);
  }

  print(min_radius);
}

main();

// var _i = 0;
//
// function readline() {
//     _i ++;
//
//     switch (_i) {
//         case 1: return '2 1000000000';
//         case 2: return '0 1000000000';
//     }
// }
//
// function write(value) {
//     console.log(value);
// }

var list = readline().split(' ');

var n = parseInt(list[0]);
var l = parseInt(list[1]);

var a = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

a.sort(function(x, y) {
    return x - y;
});

var ans = Math.max(a[0], l - a[a.length - 1]);

for (var i = 1; i < a.length; i ++) {
    ans = Math.max(ans, (a[i] - a[i-1]) / 2);
}

write(ans);

var tokens = readline().split(" ");
var n = +tokens[0];
var l = +tokens[1];
var array = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1;
for(var i = 1; i < n; i++){
    var value = array[i] - array[i-1];
    max = max > value ? max : value;
}
var res = Math.max(max/2,array[0] - 0, l - array[n-1] );
write(res);

var input = readline().split(' ').map(x => parseInt(x));
var n = input[0], l = input[1];
var sorted = readline().split(' ').map(x => parseInt(x)).sort((a,b) => a-b);
var difference = -Infinity;
for (var i = 1; i < sorted.length; i++) difference = Math.max(difference, sorted[i] - sorted[i-1]);
difference /= 2;
if (sorted[0] !== 0) difference = Math.max(sorted[0], difference);
if (sorted[n-1] !== l) difference = Math.max(difference, l - sorted[n-1]);
print(difference);

class Utility {
    static stringToInts(str) {
       let digits = [];
       for (let i = 0; i < str.length; i++)
          digits.push(parseInt(str.charAt(i)));
       return digits;
    }
    static parseToInts(str, separator) {
       let digits = [];
       Utility.forEach(str.split(separator), s => { digits.push(parseInt(s)); });
       return digits;
    }
    static forEach(arr, fnc) {
       for (let i = 0; i < arr.length; i++)
          fnc(arr[i]);
    }
    static max(p1, p2) {
       return p1 > p2 ? p1 : p2;
    }
    static reverse(arr) {
       let rarr = [];
       for (let i = arr.length - 1; i >= 0; i--)
          rarr.push(arr[i]);
       return rarr;
    }
    static range(n) {
       let range = [];
       for (let i = 1; i <= n; i++)
          range.push(i);
       return range;
    }
    static equals(arr1, arr2) {
       return JSON.stringify(arr1) == JSON.stringify(arr2);
    }
    static processStdin(afterCallback) {
       process.stdin.resume();
       process.stdin.setEncoding('utf-8');

       let inputString = '';

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

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

          afterCallback(inputString);
       });
    }
 }

function solve(input) {
    let d = Utility.parseToInts(input[0], ' ');
    let n = d[0], l = d[1];
    let A = Utility.parseToInts(input[1], ' ');
    A = A.sort((a, b) => a - b);

    let maxDist = 0;
    if (n > 0) {
        if (A[0] != 0) maxDist = A[0];
        if (A[A.length - 1] != l) {
            let md = l - A[A.length - 1];
            if (md > maxDist) maxDist = md;
        }

        for (let i = 1; i < A.length; i++) {
            let md = (A[i] - A[i - 1]) / 2;
            if (md > maxDist) maxDist = md;
        }
    }
    console.log(maxDist.toFixed(10));
}

Utility.processStdin(solve);

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

const input = [];

function splitAndParseInt(line) {
  return line.split(" ").map((x) => parseInt(x));
}

readLine.on("line", (line) => input.push(line));
readLine.on("close", () => {
  const [n, l] = splitAndParseInt(input[0]);
  const nums = splitAndParseInt(input[1]);

  nums.sort((a, b) => a - b);
  let maxD = 0;

  if (nums.length > 1)
    for (let i = 1; i < nums.length; i += 1) {
      maxD = nums[i] - nums[i - 1] > maxD ? nums[i] - nums[i - 1] : maxD;
    }

  if (nums[0] * 2 > maxD) maxD = nums[0] * 2;
  if ((l - nums[nums.length - 1]) * 2 > maxD)
    maxD = (l - nums[nums.length - 1]) * 2;

  console.log((maxD / 2).toFixed(9));
});

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

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let [n, l]  = input[0].split(' ').map(x => parseInt(x));
  const nums = input[1].split(' ').map(x => parseInt(x));

  nums.sort((a, b) => a - b);
  let max = (nums.length === 1) ? Math.max(nums[0], l-nums[0]) : 0;

  for (let i = 1; i < nums.length; i += 1) {
    if (Math.abs(nums[i] - nums[i-1]) > max) max = Math.abs(nums[i] - nums[i-1])
  }

  max /= 2;
  if (nums[0] >= max || l-nums[nums.length-1] >= max) {
    console.log(Math.max(nums[0], l-nums[nums.length-1]).toPrecision(9))
  } else console.log(max.toPrecision(9));
});

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

const input = [];
readline.on('line', line => { input.push(line); });

readline.on('close', () => {
    const [n, l] = input[0].split(' ').map(Number);
    const arr = input[1].split(' ').map(Number);
    arr.sort((a, b) => a - b);
    let dist = arr[0] - 0;
    if ((l - arr[arr.length - 1]) > dist) dist = l - arr[arr.length - 1];
    for (let i = 1; i < arr.length; i++) {
        if (((arr[i] - arr[i - 1]) / 2) > dist) dist = (arr[i] - arr[i - 1]) / 2;
    }
    console.log(dist);
});

let solution = function (n, l, arr) {
  arr.sort((x, y) => (x - y))
  // let check = function(i) {
  //   let smallest = 0
  //   for(let x of arr) {
  //     let left = x - i
  //     let right = x + i
  //     if(left > smallest+1) return false
  //     smallest = right
  //   }
  //   return right >= l
  // }

  // let left = 1
  // let right = l
  // while(left > right) {
  //   let mid = Math.floor((left + right)/2)
  //   if(check(mid)) {
  //     right = mid-1
  //   } else {
  //     left = mid+1
  //   }
  // }
  // while(check(left)) {
  //   left--
  // }
  // return left+1
  let max = 0
  let first = arr[0]
  let last = l - arr[arr.length-1]
  for(let i = 1; i<arr.length; i++) {
    let right = arr[i]
    let left = arr[i-1]
    let x = (right - left)/2
    max = Math.max(max, x)
  }
  return Math.max(max, first, last)
}

// console.log(solution(7, 15, [15,5,3,7,9,14,0]))

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

let lineCount = 0
var n, l, arr

rl.on('line', (line) => {
  lineCount++
  if(lineCount === 1) {
    [n, l] = line.split(' ').map(x => parseInt(x))
  }
  if(lineCount === 2) {
    arr = line.split(' ').map(x => parseInt(x))
    // console.log(n, l, arr)
    result = solution(n, l, arr)
    console.log(result)
  }
})

let fs = require('fs');

let txt = fs.readFileSync(0, "utf-8").split(/[\n\r]/).filter(data => data.length > 0);

for (let i = 0; i < txt.length; i += 2) {
    let info = txt[i].split(" ");
    doit(info[1] * 1, txt[i + 1].split(" ").filter(data => data.length > 0).map(data => data * 1).sort((a, b) => a - b));
}

function doit(n, tab) {
    let changes = tab[0];
    let g = (n - tab[tab.length - 1]);
    if (g > changes) changes = g;
    for (let i = 1; i < tab.length; i++) {
        let r = (tab[i] - tab[i - 1]) / 2;
        if (changes < r) changes = r;
    }
    console.log(changes);

}

var input = readline(), n = +input[0], l = +input[1],
a = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1, x;

for(i = 1; i < n; i++){
	x = a[i] - a[i-1];
	max = (x > max) ? x : max;
}

max = Math.max(max/2, Math.max((l - a[n-1]), a[0]));

write(max.toFixed(10));

var inp = readline().split(" ").map(function(x){return parseInt(x);});
var n = inp[0];
var l = inp[1];

var a = readline().split(" ").map(function(x){return parseInt(x);});
a.sort(function(e,x){return e > x;});
if (a[0] != 0){
	a.unshift(-a[0]);
	n++;
}
if (a[n-1] != l){
	a.push(l + (l-a[n-1]));
	n++;
}
var max = 0;
var dif = max;
for(var i=1; i < n; i++){
	dif =  a[i] - a[i-1];
	if (dif > 0 && dif > max) max = dif;
}

print(max/2);

var ints = function() {
	return readline().split(' ').map(function(w) {
		return parseInt(w)
	})
}

var minus = function(a, b) {
    return a - b
}

var numbers = ints()
	n = numbers[0],
	l = numbers[1]
numbers = ints()
numbers.sort(minus)

var result = numbers.reduce(function(current, position) {
	current.max = Math.max(current.max, position - current.position)
	current.position = position
	return current
}, {
	max: 0,
	position: 0
})

print((result.max / 2).toFixed(9))

var input = readline().trim().split(' ').map((x)=>parseInt(x));
var a = readline().trim().split(' ').map((x)=>parseInt(x));

a.sort((a,b)=>a-b);

var b =[];
for (var i = 0; i < a.length-1; i++) {
	b.push(a[i+1]-a[i]);
}

b.sort((a,b)=>b-a)
print(Math.max((b[0]*1.0)/2,a[0],input[1]-a[a.length-1]));

var s = readline().split(' ');
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(' ').map(el => parseInt(el)).sort((a, b) => a - b)
var maxDif = Math.max(s[0] * 2, (l - s[n - 1] * 2));
for (var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i - 1]);
}
print(maxDif / 2);

var s = readline().split(' ');
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(' ').map(Number).sort((a, b) => a - b)
var maxDif = Math.max(s[0] * 2, (l - s[n - 1] * 2));
for (var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i - 1]);
}
print(maxDif / 2);

var s = readline().split(' ');
var n = Number(s[0]), l = Number(s[1]);
s = readline().split(' ').map(el => parseFloat(el)).sort((a, b) => a - b)
var maxDif = Math.max(s[0] * 2, (l - s[n - 1] * 2));
for (var i = 1; i < n; i++) {
    maxDif = Math.max(maxDif, s[i] - s[i - 1]);
}
print(maxDif / 2);

'use strict'

String.prototype.getNumArray = function () {
  return String(this).split(' ').map(function (value) {
    return parseInt(value);
  });
}

let _arr = readline().getNumArray(),
    n = _arr[0],
    l = _arr[1],
    array = readline().getNumArray(),
    maxDistance = 0;

array.sort(function(a, b) {
  return a - b;
});

for(let i = 1; i < array.length; i++) {
  if(array[i] - array[i - 1] > maxDistance) {
    maxDistance = array[i] - array[i - 1];
  }
}

if (array[0] > maxDistance / 2 || l - array[array.length - 1] > maxDistance / 2) {
  if(array[0] > maxDistance / 2) {
    maxDistance =array[0];
  } else {
    maxDistance = l - array[array.length - 1];
  }
} else {
  maxDistance = maxDistance / 2;
}
write(maxDistance);

'use strict'

String.prototype.getNumArray = function () {
  return String(this).split(' ').map(function (value) {
    return parseInt(value);
  });
}

let _arr = readline().getNumArray(),
    n = _arr[0],
    l = _arr[1],
    array = readline().getNumArray(),
    maxDistance = 0;

array.push(0);
array.push(l);

array.sort(function(a, b) {
  return a - b;
});

for(let i = 1; i < array.length; i++) {
  if(array[i] - array[i - 1] > maxDistance) {
    maxDistance = array[i] - array[i - 1];
  }
}

write(maxDistance / 2);

var f = readline().split(" ");
var str = readline().split(" ").sort((x,y)=>x-y);
var res = Math.min.apply(this, str);
	for (var i=0; i<+f[0]; i++){
			if (Number(str[i+1])-Number(str[i])>res)
				res = +str[i+1]-Number(str[i]);

	}
	print(Math.min.apply(this, str)!=0? Math.min.apply(this, str): res/2);

var f = readline().split(" ");
var str = readline().split(" ").sort((x,y)=>x-y);
var res = 0;
	for (var i=0; i<+f[0]; i++){
			if (Number(str[i+1])-Number(str[i])>res)
				res = +str[i+1]-Number(str[i]);

	}
	print(res/2>=Math.min.apply(this, str)? res/2:Math.min.apply(this, str));

var main = function(nPositions, l)
{
	var max = 0;
	var increase = function(a, b)
	{
		return +a - +b;
	}
	var toAnArray = function(str)
	{
		str = str.split(' ');
		return str;
	}
	nPositions = toAnArray(nPositions);
	nPositions.sort(increase);
	for (var i = 1; i <= nPositions.length - 1; i++)
	{
		if (+nPositions[i] - +nPositions[i - 1] > max) max = +nPositions[i] - +nPositions[i - 1];
	}
	if (+nPositions[0] > max / 2) return (+nPositions[0]).toFixed(10);
	else if (l - +nPositions[nPositions.length - 1] > max / 2) return (l - +nPositioins[nPositions.length - 1]).toFixed(10);
	else return (max / 2).toFixed(10);

}

{
	var lAndN = readline(),
	nPositions = readline();
	lAndN = lAndN.split(' ');
	print(main(nPositions, +lAndN[1]));
}

var main = function(nPositions, l)
{
	var max = 0;
	var increase = function(a, b)
	{
		return +a - +b;
	}
	var toAnArray = function(str)
	{
		str = str.split(' ');
		return str;
	}
	nPositions = toAnArray(nPositions);
	nPositions.sort(increase);
	for (var i = 1; i <= nPositions.length - 1; i++)
	{
		if (+nPositions[i] - +nPositions[i - 1] > max) max = +nPositions[i] - +nPositions[i - 1];
	}
	if (((+nPositions[0] > max / 2) && (l - +nPositions[nPositions.length - 1] > max / 2)) && (+nPositions[0] > l - +nPositions[nPositions.length - 1] ) )return +nPositions[0];
		else if (((+nPositions[0] > max / 2) && (l - +nPositions[nPositions.length - 1] > max / 2)) && (+nPositions[0] < l - +nPositions[nPositions.length - 1] ) )return l - +nPositions[nPositions.length - 1];
		else if (+nPositions[0] > max / 2) return +nPositions[0];
		else if (l - +nPositions[nPositions.length - 1] > max / 2) return l - +nPositions[nPositions.length - 1] > max / 2;
		else return max / 2;

}

{
	var lAndN = readline(),
	nPositions = readline();
	lAndN = lAndN.split(' ');
	print(main(nPositions, +lAndN[1]));
}

var inp = readline().split(' ');
var a = readline().split(' ');

for(var i=0; i<inp.length; i++) {
    inp[i] = parseInt(inp[i], 10);
}
var n = inp[0], m = inp[1];

for(var i=0; i<a.length; i++) {
    a[i] = parseInt(a[i], 10);
}

a.sort((a,b) => a-b);

var max_d = -Infinity;

for(var i=0; i<a.length; i++) {
    if(i === 0 && a[i-1] !== 0) max_d = a[i];
    else if((a[i] - a[i-1])/2 > max_d) max_d = (a[i] - a[i-1])/2;
}

print(max_d);

(function main() {
    var line = readline().split(" "),
        l = line[0],
        n = line[1],
        aStrings = readline().split(" "),
        a = [],
        d,
        i;

    for (i in aStrings) {
        a[i] = +aStrings[i];
    }

    a.sort(function(a, b) {
        return a - b;
    });

    d = Math.max(a[0], l - a[a.length - 1]);

    for (i = 1; i < a.length; i++) {
        d = Math.max(d, (a[i] - a[i-1]) / 2);
    }

    print(d.toFixed(10));
})();

'use strict';

// const rlLib = require('readline');

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

// let inputs = [];
// let allCount = 2;
// let currentLine = 0;

// rl.on('line', (input) => {
// 	inputs.push(input);
// 	if (inputs.length === allCount) {
// 		main();

// 		rl.close();
// 	}
// });

// function readline() {
// 	return inputs[currentLine++];
// }
// function print() {
// 	console.log.apply(this, arguments);
// }

// function main() {
	let rl = readline().split(' ').map(function(e) {return parseInt(e);});
	let f = readline().split(' ').map(function(e) {return parseInt(e, 10);});

	f = f.sort(function(a, b) {return a - b;});

	if (f[f.length - 1] !== rl[1]) {
		f.push(rl[1] * 2);
	}

	let res = f[0] * 2;

	f.forEach(function(e, i) {
		if (i+1 < f.length && (f[i+1] - f[i]) > res) {
			res = f[i+1] - f[i];
		}
	});

	print(res / 2);
// }

// var _i = 0;
//
// function readline() {
//     _i ++;
//
//     switch (_i) {
//         case 1: return '2 1000000000';
//         case 2: return '0 1000000000';
//     }
// }
//
// function write(value) {
//     console.log(value);
// }

function f(d) {
    if (d < a[0] || a[a.length-1] + d < l) {
        return false;
    }

    for (var i = 1; i < a.length; i ++) {
        if (a[i-1] + d < a[i] - d) {
            return false;
        }
    }

    return true;
}

var list = readline().split(' ');

var n = parseInt(list[0]);
var l = parseInt(list[1]);

var a = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

a.sort(function(x, y) {
    return x - y;
});

var x = 0;
var y = l;
var m;

var EPS = 10e-6;

while (Math.abs(x - y) > EPS) {
    m = (x + y) / 2;
    if (f(m)) {
        y = m;
    } else {
        x = m;
    }
}

write(m);

var tokens = readline().split(" ");
var n = +tokens[0];
var l = +tokens[1];
var array = readline().split(" ").map(Number).sort(function(x,y){return x-y});
var max = -1;
for(var i = 1; i < n; i++){
    var value = array[1] - array[0];
    max = max > value ? max : value;
}
var res = Math.max(max/2,array[0] - 0, l - array[n-1] );
write(res);

class Utility {
    static stringToInts(str) {
       let digits = [];
       for (let i = 0; i < str.length; i++)
          digits.push(parseInt(str.charAt(i)));
       return digits;
    }
    static parseToInts(str, separator) {
       let digits = [];
       Utility.forEach(str.split(separator), s => { digits.push(parseInt(s)); });
       return digits;
    }
    static forEach(arr, fnc) {
       for (let i = 0; i < arr.length; i++)
          fnc(arr[i]);
    }
    static max(p1, p2) {
       return p1 > p2 ? p1 : p2;
    }
    static reverse(arr) {
       let rarr = [];
       for (let i = arr.length - 1; i >= 0; i--)
          rarr.push(arr[i]);
       return rarr;
    }
    static range(n) {
       let range = [];
       for (let i = 1; i <= n; i++)
          range.push(i);
       return range;
    }
    static equals(arr1, arr2) {
       return JSON.stringify(arr1) == JSON.stringify(arr2);
    }
    static processStdin(afterCallback) {
       process.stdin.resume();
       process.stdin.setEncoding('utf-8');

       let inputString = '';

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

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

          afterCallback(inputString);
       });
    }
 }

function solve(input) {
    console.log(input);
    let d = Utility.parseToInts(input[0], ' ');
    let n = d[0], l = d[1];
    let A = Utility.parseToInts(input[1], ' ');
    A.sort((a, b) => a >= b);

    let maxDist = 0;
    if (n > 0) {
        if (A[0] != 0) maxDist = A[0];
        if (A[A.length - 1] != l) {
            let md = l - A[A.length - 1];
            if (md > maxDist) maxDist = md;
        }

        for (let i = 1; i < A.length; i++) {
            let md = (A[i] - A[i - 1]) / 2;
            if (md > maxDist) maxDist = md;
        }
    }
    console.log(maxDist.toFixed(10));
}

Utility.processStdin(solve);

class Utility {
    static stringToInts(str) {
       let digits = [];
       for (let i = 0; i < str.length; i++)
          digits.push(parseInt(str.charAt(i)));
       return digits;
    }
    static parseToInts(str, separator) {
       let digits = [];
       Utility.forEach(str.split(separator), s => { digits.push(parseInt(s)); });
       return digits;
    }
    static forEach(arr, fnc) {
       for (let i = 0; i < arr.length; i++)
          fnc(arr[i]);
    }
    static max(p1, p2) {
       return p1 > p2 ? p1 : p2;
    }
    static reverse(arr) {
       let rarr = [];
       for (let i = arr.length - 1; i >= 0; i--)
          rarr.push(arr[i]);
       return rarr;
    }
    static range(n) {
       let range = [];
       for (let i = 1; i <= n; i++)
          range.push(i);
       return range;
    }
    static equals(arr1, arr2) {
       return JSON.stringify(arr1) == JSON.stringify(arr2);
    }
    static processStdin(afterCallback) {
       process.stdin.resume();
       process.stdin.setEncoding('utf-8');

       let inputString = '';

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

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

          afterCallback(inputString);
       });
    }
 }

function solve(input) {
    let d = Utility.parseToInts(input[0], ' ');
    let n = d[0], l = d[1];
    let A = Utility.parseToInts(input[1], ' ');
    A = A.sort((a, b) => a - b);
    console.log(n);
    console.log(l);
    console.log(A);

    let maxDist = 0;
    if (n > 0) {
        if (A[0] != 0) maxDist = A[0];
        if (A[A.length - 1] != l) {
            let md = l - A[A.length - 1];
            if (md > maxDist) maxDist = md;
        }

        for (let i = 1; i < A.length; i++) {
            let md = (A[i] - A[i - 1]) / 2;
            if (md > maxDist) maxDist = md;
        }
    }
    console.log(maxDist.toFixed(10));
}

Utility.processStdin(solve);

class Utility {
    static stringToInts(str) {
       let digits = [];
       for (let i = 0; i < str.length; i++)
          digits.push(parseInt(str.charAt(i)));
       return digits;
    }
    static parseToInts(str, separator) {
       let digits = [];
       Utility.forEach(str.split(separator), s => { digits.push(parseInt(s)); });
       return digits;
    }
    static forEach(arr, fnc) {
       for (let i = 0; i < arr.length; i++)
          fnc(arr[i]);
    }
    static max(p1, p2) {
       return p1 > p2 ? p1 : p2;
    }
    static reverse(arr) {
       let rarr = [];
       for (let i = arr.length - 1; i >= 0; i--)
          rarr.push(arr[i]);
       return rarr;
    }
    static range(n) {
       let range = [];
       for (let i = 1; i <= n; i++)
          range.push(i);
       return range;
    }
    static equals(arr1, arr2) {
       return JSON.stringify(arr1) == JSON.stringify(arr2);
    }
    static processStdin(afterCallback) {
       process.stdin.resume();
       process.stdin.setEncoding('utf-8');

       let inputString = '';

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

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

          afterCallback(inputString);
       });
    }
 }

function solve(input) {
    let d = Utility.parseToInts(input[0], ' ');
    let n = d[0], l = d[1];
    let A = Utility.parseToInts(input[1], ' ');
    A.sort((a, b) => a >= b);

    let maxDist = 0;
    if (n > 0) {
        if (A[0] != 0) maxDist = A[0];
        if (A[A.length - 1] != l) {
            let md = l - A[A.length - 1];
            if (md > maxDist) maxDist = md;
        }

        for (let i = 1; i < A.length; i++) {
            let md = (A[i] - A[i - 1]) / 2;
            if (md > maxDist) maxDist = md;
        }
    }
    console.log(maxDist.toFixed(10));
}

Utility.processStdin(solve);

class Utility {
    static stringToInts(str) {
       let digits = [];
       for (let i = 0; i < str.length; i++)
          digits.push(parseInt(str.charAt(i)));
       return digits;
    }
    static parseToInts(str, separator) {
       let digits = [];
       Utility.forEach(str.split(separator), s => { digits.push(parseInt(s)); });
       return digits;
    }
    static forEach(arr, fnc) {
       for (let i = 0; i < arr.length; i++)
          fnc(arr[i]);
    }
    static max(p1, p2) {
       return p1 > p2 ? p1 : p2;
    }
    static reverse(arr) {
       let rarr = [];
       for (let i = arr.length - 1; i >= 0; i--)
          rarr.push(arr[i]);
       return rarr;
    }
    static range(n) {
       let range = [];
       for (let i = 1; i <= n; i++)
          range.push(i);
       return range;
    }
    static equals(arr1, arr2) {
       return JSON.stringify(arr1) == JSON.stringify(arr2);
    }
    static processStdin(afterCallback) {
       process.stdin.resume();
       process.stdin.setEncoding('utf-8');

       let inputString = '';

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

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

          afterCallback(inputString);
       });
    }
 }

function solve(input) {
    let d = Utility.parseToInts(input[0], ' ');
    let n = d[0], l = d[1];
    let A = Utility.parseToInts(input[1], ' ');
    A.sort((a, b) => a >= b);
    console.log(n);
    console.log(l);
    console.log(A);

    let maxDist = 0;
    if (n > 0) {
        if (A[0] != 0) maxDist = A[0];
        if (A[A.length - 1] != l) {
            let md = l - A[A.length - 1];
            if (md > maxDist) maxDist = md;
        }

        for (let i = 1; i < A.length; i++) {
            let md = (A[i] - A[i - 1]) / 2;
            if (md > maxDist) maxDist = md;
        }
    }
    console.log(maxDist.toFixed(10));
}

Utility.processStdin(solve);

class Utility {
    static stringToInts(str) {
       let digits = [];
       for (let i = 0; i < str.length; i++)
          digits.push(parseInt(str.charAt(i)));
       return digits;
    }
    static parseToInts(str, separator) {
       let digits = [];
       Utility.forEach(str.split(separator), s => { digits.push(parseInt(s)); });
       return digits;
    }
    static forEach(arr, fnc) {
       for (let i = 0; i < arr.length; i++)
          fnc(arr[i]);
    }
    static max(p1, p2) {
       return p1 > p2 ? p1 : p2;
    }
    static reverse(arr) {
       let rarr = [];
       for (let i = arr.length - 1; i >= 0; i--)
          rarr.push(arr[i]);
       return rarr;
    }
    static range(n) {
       let range = [];
       for (let i = 1; i <= n; i++)
          range.push(i);
       return range;
    }
    static equals(arr1, arr2) {
       return JSON.stringify(arr1) == JSON.stringify(arr2);
    }
    static processStdin(afterCallback) {
       process.stdin.resume();
       process.stdin.setEncoding('utf-8');

       let inputString = '';

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

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

          afterCallback(inputString);
       });
    }
 }

function solve(input) {
    let d = Utility.parseToInts(input[0], ' ');
    let n = d[0], l = d[1];
    let A = Utility.parseToInts(input[1], ' ');
    A = A.sort((a, b) => a >= b);
    console.log(n);
    console.log(l);
    console.log(A);

    let maxDist = 0;
    if (n > 0) {
        if (A[0] != 0) maxDist = A[0];
        if (A[A.length - 1] != l) {
            let md = l - A[A.length - 1];
            if (md > maxDist) maxDist = md;
        }

        for (let i = 1; i < A.length; i++) {
            let md = (A[i] - A[i - 1]) / 2;
            if (md > maxDist) maxDist = md;
        }
    }
    console.log(maxDist.toFixed(10));
}

Utility.processStdin(solve);

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

const input = [];
readline.on('line', line => { input.push(line); });

readline.on('close', () => {
    const [n, l] = input[0].split(' ').map(Number);
    const arr = input[1].split(' ').map(Number);
    arr.sort((a, b) => a - b);
    let dist = arr[0] - 0;
    if ((l - arr[arr.length - 1]) > dist) dist = l - arr[arr.length - 1];
    console.log(dist);
    for (let i = 1; i < arr.length; i++) {
        if (((arr[i] - arr[i - 1]) / 2) > dist) dist = (arr[i] - arr[i - 1]) / 2;
    }
    console.log(dist);
});

let solution = function (n, l, arr) {
  arr.sort((x, y) => (x - y))
  // let check = function(i) {
  //   let smallest = 0
  //   for(let x of arr) {
  //     let left = x - i
  //     let right = x + i
  //     if(left > smallest+1) return false
  //     smallest = right
  //   }
  //   return right >= l
  // }

  // let left = 1
  // let right = l
  // while(left > right) {
  //   let mid = Math.floor((left + right)/2)
  //   if(check(mid)) {
  //     right = mid-1
  //   } else {
  //     left = mid+1
  //   }
  // }
  // while(check(left)) {
  //   left--
  // }
  // return left+1
  let max = 0
  let first = arr[0]
  let last = l - arr[arr.length-1]
  for(let i = 1; i<arr.length; i++) {
    let right = arr[i]
    let left = arr[i-1]
    let x = (right - left)/2
    max = Math.max(max, x)
  }
  return Math.max(max, first, last)
}

// console.log(solution(7, 15, [15,5,3,7,9,14,0]))

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

let lineCount = 0
var n, l, arr

rl.on('line', (line) => {
  lineCount++
  if(lineCount === 1) {
    [n, l] = line.split(' ').map(x => parseInt(x))
  }
  if(lineCount === 2) {
    arr = line.split(' ').map(x => parseInt(x))
    // console.log(n, l, arr)
    result = solution(n, l, arr)
    // console.log(result)
  }
})

let fs = require('fs');

let txt = fs.readFileSync(0, "utf-8").split(/[\n\r]/).filter(data => data.length > 0);

for (let i = 0; i < txt.length; i += 2) {
    let info = txt[i].split(" ");
    doit(info[1] * 1, txt[i + 1].split(" ").filter(data => data.length > 0).map(data => data * 1).sort((a, b) => a - b));
}

function doit(n, tab) {
    let changes = tab[0];
    let g = (n - tab[tab.length - 1]);
    if (g > changes) chenges = g;
    for (let i = 1; i < tab.length; i++) {
        let r = (tab[i] - tab[i - 1]) / 2;
        if (changes < r) changes = r;
    }
    console.log(changes);

}

let fs = require('fs');

let txt = fs.readFileSync(0, "utf-8").split(/[\n\r]/).filter(data => data.length > 0);

for (let i = 0; i < txt.length; i+=2) {
    let info=txt[i].split(" ");
    doit(info[1] * 1, txt[i+1].split(" ").filter(data=>data.length>0).map(data=>data*1).sort((a,b)=>a-b));
}

function doit(n, tab) {
    let changes=tab[0];
    if((n-tab[tab.length-1])/2>changes)chenges=(n-tab[tab.length-1]);
    for (let i = 1; i < tab.length; i++) {
        if(changes<(tab[i]-tab[i-1])/2)changes=(tab[i]-tab[i-1])/2;
    }
    console.log(changes);

}


You are given four integers $$$n$$$, $$$c_0$$$, $$$c_1$$$ and $$$h$$$ and a binary string $$$s$$$ of length $$$n$$$.A binary string is a string consisting of characters $$$0$$$ and $$$1$$$.You can change any character of the string $$$s$$$ (the string should be still binary after the change). You should pay $$$h$$$ coins for each change.After some changes (possibly zero) you want to buy the string. To buy the string you should buy all its characters. To buy the character $$$0$$$ you should pay $$$c_0$$$ coins, to buy the character $$$1$$$ you should pay $$$c_1$$$ coins.Find the minimum number of coins needed to buy the string.

The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 10$$$) — the number of test cases. Next $$$2t$$$ lines contain descriptions of test cases. The first line of the description of each test case contains four integers $$$n$$$, $$$c_{0}$$$, $$$c_{1}$$$, $$$h$$$ ($$$1 \leq n, c_{0}, c_{1}, h \leq 1000$$$). The second line of the description of each test case contains the binary string $$$s$$$ of length $$$n$$$.

For each test case print a single integer — the minimum number of coins needed to buy the string.

NoteIn the first test case, you can buy all characters and pay $$$3$$$ coins, because both characters $$$0$$$ and $$$1$$$ costs $$$1$$$ coin.In the second test case, you can firstly change $$$2$$$-nd and $$$4$$$-th symbols of the string from $$$1$$$ to $$$0$$$ and pay $$$2$$$ coins for that. Your string will be $$$00000$$$. After that, you can buy the string and pay $$$5 \cdot 10 = 50$$$ coins for that. The total number of coins paid will be $$$2 + 50 = 52$$$.

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

// utils
const MOD = 1e9 + 7;
const mod = (n) => ((n % MOD) + MOD) % MOD;
const add = (a, b) => mod(mod(a) + mod(b));
const sub = (a, b) => mod(mod(a) - mod(b));
function mul() {
  for (var a = arguments, r = a[0], i = a.length; --i; )
    r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;
  return r;
}
function inv(b) {
  for (var a = MOD, u = 0, v = 1, t; b; v = t)
    (t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);
  u %= MOD;
  return u < 0 ? u + MOD : u;
}
function pow(base, n) {
  if (n === 0) return 1;
  let p = pow(base, Math.floor(n / 2));
  let res = mul(mod(p), mod(p));
  if (n % 2 === 1) res = mul(mod(res), base);
  return res;
}
function highestOneBit(i) {
  i |= i >> 1;
  i |= i >> 2;
  i |= i >> 4;
  i |= i >> 8;
  i |= i >> 16;
  return i - (i >>> 1);
}
function permutation(arr, len, store = "", permutations = []) {
  if (store.length === len) {
    permutations.push(store);
    return;
  }
  for (let i = 0; i < arr.length; i++) {
    const newArr = [...arr];
    const newChar = newArr.splice(i, 1);
    permutation(newArr, len, store.concat(newChar), permutations);
  }
  return permutations;
}

function main() {
  let t = +readLine();
  while (t--) {
    const [n, c0, c1, h] = readLine().split(" ").map(Number);
    const str = readLine();
    let [min, count0, count1, count] = [Infinity, 0, 0, 0];

    for (let i = 0; i < str.length; i++) {
      if (str[i] === "0") count0++;
      else count1++;
    }

    count = count0 * c0 + count1 * c1;
    min = Math.min(min, count);
    // all 0
    count = n * c0 + count1 * h;
    min = Math.min(count, min);
    // all 1
    count = n * c1 + count0 * h;
    min = Math.min(count, min);
    //  01
    count = 0;
    for (let i = 0; i < n; i++) {
      const char = str[i];
      if (i % 2 === 0) {
        if (char === "0") count += c0;
        else count += c0 + h;
      } else {
        if (char === "1") count += c1;
        else count += c1 + h;
      }
    }
    min = Math.min(min, count);
    //  10
    count = 0;
    for (let i = 0; i < n; i++) {
      const char = str[i];
      if (i % 2 === 0) {
        if (char === "1") count += c1;
        else count += c1 + h;
      } else {
        if (char === "0") count += c0;
        else count += c0 + h;
      }
    }
    min = Math.min(min, count);

    console.log(min);
  }
}

//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 one = nextIntArray();
		var N = one[0];
		var c0 = one[1];
		var c1 = one[2];
		var h = one[3];
		var s = nextCharArray();
		var sum = 0;
		for(var j = 0; j < N; j++){
			if(s[j] == "0"){
				sum += Math.min(c0, c1 + h);
			}else{
				sum += Math.min(c1, c0 + h);
			}
		}
		output[i] = sum;
	}
	myout(myconv(output, 9));
}

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

let i = 1;
let t = 0;
let input1 = 0;

// untuk input per test > 1
readline.on('line', line => {
    if (i == 1) {
        // number of test case
        t = parseInt(line)
        i++;
    } else {
        if (i % 2 === 0) input1 = line;
        else solve(input1, line)

        if (i <= t*2) i++
        else readline.close()
    }
});

// =========== DEFAULT FORMAT END ==============
const countObj = (arr, val)  => arr.reduce((a, v) => (v == val ? a + 1 : a), 0);

function solve(line1, line2) {
    // your code here
    const [n, c0, c1, h] = line1.split(' ').map(item => parseInt(item));
    const binaryS = line2.split('')
    const a = c1 * n + (countObj(binaryS, '0') * h);
    const b = c0 * n + (countObj(binaryS, '1') * h);
    const c = (c0 * countObj(binaryS, 0) + c1 * countObj(binaryS, 1))
    console.log(Math.min(a, b, c))
  }

(()=>{"use strict";var t={675:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),Array.numbersMatrix=(t,e,r)=>{let n=[];null==t&&(e=t),null==r&&(r=0);for(let i=0;i<t;++i){let t=[];for(let n=0;n<e;++n)t.push(r);n.push(t)}return n},Array.prototype.sortAsc=function(){return this.sort(((t,e)=>t-e))},Array.prototype.sortDesc=function(){return this.sort(((t,e)=>e-t))},Array.prototype.max=function(){if(0==this.length)return 0;let t=this[0];for(let e=1;e<this.length;++e)t=Math.max(t,this[e]);return t},Array.prototype.min=function(){if(0==this.length)return 0;let t=this[0];for(let e=1;e<this.length;++e)t=Math.min(t,this[e]);return t},Array.prototype.sum=function(){let t=0;for(let e=0;e<this.length;++e)t+=this[e];return t},Array.prototype.modSum=function(t){let e=0;for(let r=0;r<this.length;++r)e+=this[r],e%=t;return e},Array.prototype.avg=function(){return this.sum()/this.length},Array.prototype.groupBy=function(t){let e=new Map;for(let r=0;r<this.length;++r){const n=t(this[r]);e.has(n)?e.get(n).push(this[r]):e.set(n,[this[r]])}return e},Array.prototype.deepCopy=function(){let t=[];if(0==this.length)return t;let e=!1;Array.isArray(this[0])&&(e=!0);for(let r=0;r<this.length;++r)e?t.push(this[r].deepCopy()):t.push(this[r]);return t},Array.prototype.transpose=function(){let t=[];if(0==this.length)return[[]];for(let e=0;e<this[0].length;++e){let r=[];for(let t=0;t<this.length;++t)r.push(this[t][e]);t.push(r)}return t},Array.prototype.toString=function(){if(0==this.length)return"";if(!Array.isArray(this[0]))return this.join(" ");let t="";for(let e=0;e<this.length;++e)t+=this[e].join(" "),e!=this.length-1&&(t+="\n");return t}},312:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(747));let o="",s=[],u=0,l="";const h="local"===process.argv[2],a=t=>{if(h){if(s=i.default.readFileSync("input.txt").toString().trim().split("\n").map((t=>t.trim())),t(),i.default.writeFileSync("output.txt",l),console.log(l),i.default.readFileSync("expected.txt").toString().trim()==l.trim()){const{exec:t}=r(129);t("osascript -e 'display notification \"✅ AC!!\"'")}}else process.stdin.resume(),process.stdin.setEncoding("utf-8"),process.stdin.on("data",(t=>{o+=t})),process.stdin.on("end",(e=>{s=o.trim().split("\n").map((t=>t.trim())),t(),console.log(l)}))};function f(){return s[u++]}function p(){return f().split(" ").map((t=>parseFloat(t)))}function c(){return f().split("")}e.default={runMain:a,runEachTest:t=>{a((()=>{let[e]=p();for(;e>0;)t(),e--}))},readline:f,nextNumbers:p,nextBigNumbers:function(){return f().split(" ").map((t=>BigInt(t)))},nextNumbersMatrix:function(t){let e=[];for(let r=0;r<t;++r)e.push(p());return e},nextCharacters:c,nextCharacterMatrix:function(t){let e=[];for(let r=0;r<t;++r)e.push(c());return e},nextIntervalArray:function(t){let e=[];for(let r=0;r<t;++r){const[t,r]=p();e.push({a:t,b:r})}return e},put:function(t){l+=t},puts:function(t){l+=t+"\n"},debug:function(t){h&&console.log(t)}}},965:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),r(675);const i=n(r(312));i.default.runEachTest((function(){let[t,e,r,n]=i.default.nextNumbers(),o=i.default.nextCharacters(),s=o.filter((t=>"0"==t)).length,u=o.filter((t=>"1"==t)).length,l=(t,n)=>e*t+r*n,h=l(s,u),a=0;for(;s>0;)s--,u++,a+=n,h=[h,a+l(s,u)].min();for(s=o.filter((t=>"0"==t)).length,u=o.filter((t=>"1"==t)).length,a=0;u>0;)u--,s++,a+=n,h=[h,a+l(s,u)].min();i.default.puts(h)}))},129:t=>{t.exports=require("child_process")},747:t=>{t.exports=require("fs")}},e={};!function r(n){if(e[n])return e[n].exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}(965)})();

// Solution written in typescript and compiled via webpack. Original source code below
// Happy Hacking 😜

// import './array'
//
// import io from './io'
//
// function main() {
//   let [n, c0, c1, h] = io.nextNumbers()
//   let a = io.nextCharacters()
//
//   let nr0 = a.filter((x) => x == "0").length
//   let nr1 = a.filter((x) => x == "1").length
//
//   let cost = (zero: number, one: number) => {
//     return c0 * zero + c1 * one
//   }
//
//   let c = cost(nr0, nr1)
//
//   let ac = 0
//
//   while (nr0 > 0) {
//     nr0--
//     nr1++
//     ac += h
//
//     c = [c, ac + cost(nr0, nr1)].min()
//   }
//
//   nr0 = a.filter((x) => x == "0").length
//   nr1 = a.filter((x) => x == "1").length
//
//   ac = 0
//
//   while (nr1 > 0) {
//     nr1--
//     nr0++
//     ac += h
//
//     c = [c, ac + cost(nr0, nr1)].min()
//   }
//
//   io.puts(c)
// }
//
// io.runEachTest(main)
// // io.runMain(main)

let input = ''

process.stdin.on('data', (x) => input += x)

process.stdin.on('end', () => {
  const lines = input.trim().split('\n')
  let curLine = 0
  const T = parseInt(lines[curLine++])
  for (let t = 0; t < T; t++) {
    const [n, c0, c1, h] = lines[curLine++].split(' ').map((x) => parseInt(x))
    const p0 = Math.min(c0, h + c1)
    const p1 = Math.min(c1, h + c0)
    let ans = 0
    lines[curLine++].trim().split('').forEach((c) => ans += c === '1' ? p1 : p0)
    console.log(ans)
  }
})

var sizeOfData = readline();
for (var dataI = 0; dataI < sizeOfData; dataI++) {
    var secondLine = readline().split(' ');
    var n = secondLine[0], c0 = secondLine[1], c1 = secondLine[2], h = secondLine[3];
    var str = readline();
    var am0 = 0;
    var am1 = 0;
    for (var c of str) {
        if (c == '0') {
            am0++;
        } else if (c == '1') {
            am1++;
        }
    }
    var normprice = am0*c0 + am1*c1;
    var c0price = am0*h + am1*c1 + am0*c1;
    var c1price = am1*h + am0*c0 + am1*c0;
    print(Math.min(normprice, c0price, c1price));
}

var tc = parseInt(readline());

while(tc--){
    var arr = readline().split(' ').map(x => parseInt(x));
    var n = arr[0];
    var c0 = arr[1];
    var c1 = arr[2];
    var h = arr[3];

    var s = readline();

    var one = 0;
    var zero = 0;
    for(var i = 0; i < n; i++){
        if(s[i]=='1')one++;
        else zero++;
    }

    var taka = 0;
    if(c0 < c1){
        taka = c0 * zero;
        if((h+c0)<=c1){
            taka += one * (h+c0);
        }else{
            taka += c1 * one;
        }
    }
    else if(c1 < c0){
        taka = c1 * one;
        if((h+c1)<=c0){
            taka += zero * (h+c1);
        }else{
            taka += c0 * zero;
        }
    }else{
        print(n*c0);
        continue;
    }

    print(taka);
}

var tc = parseInt(readline());

while(tc--){
    var arr = readline().split(' ').map(x => parseInt(x));
    var n = arr[0];
    var c0 = arr[1];
    var c1 = arr[2];
    var h = arr[3];

    var s = readline();

    var one = 0;
    var zero = 0;
    for(var i = 0; i < n; i++){
        if(s[i]=='1')one++;
        else zero++;
    }

    var taka = 0;
    var change = 0;
    if(c0 < c1){
        taka = c0 * zero;
        if(h < c1){
            change += h*one;
            change += c0 * one;
            if(change < c1 * one)taka += change;

        }else{
            taka += c1 * one;
        }
    }
    else if(c1 < c0){
        taka = c1 * one;
        if(h < c0){
            change += h*zero;
            change += c1*zero;
            if(change < c0 * zero)taka += change;
        }else{
            taka += c0 * zero;
        }
    }else{
        print(n*c0);
        continue;
    }

    print(taka);
}

var tc = parseInt(readline());

while(tc--){
    var arr = readline().split(' ').map(x => parseInt(x));
    var n = arr[0];
    var c0 = arr[1];
    var c1 = arr[2];
    var h = arr[3];

    var s = readline();

    var one = 0;
    var zero = 0;
    for(var i = 0; i < n; i++){
        if(s[i]=='1')one++;
        else zero++;
    }

    var taka = 0;
    if(c0 < c1){
        taka = c0 * zero;
        if(h*one < c1*one){
            taka += h*one;
            taka += c0*one;
        }else{
            taka += c1*one;
        }
    }
    else if(c1 < c0){
        taka = c1 * one;
        if(h*zero < c0*zero){
            taka += h*zero;
            taka += c1*zero;
        }else{
            taka += c0*zero;
        }
    }else{
        print(n*c0);
        continue;
    }

    print(taka);
}


The Berland University is preparing to celebrate the 256-th anniversary of its founding! A specially appointed Vice Rector for the celebration prepares to decorate the campus. In the center of the campus n ice sculptures were erected. The sculptures are arranged in a circle at equal distances from each other, so they form a regular n-gon. They are numbered in clockwise order with numbers from 1 to n.The site of the University has already conducted a voting that estimated each sculpture's characteristic of ti — the degree of the sculpture's attractiveness. The values of ti can be positive, negative or zero.When the university rector came to evaluate the work, he said that this might be not the perfect arrangement. He suggested to melt some of the sculptures so that:   the remaining sculptures form a regular polygon (the number of vertices should be between 3 and n),  the sum of the ti values of the remaining sculptures is maximized. Help the Vice Rector to analyze the criticism — find the maximum value of ti sum which can be obtained in this way. It is allowed not to melt any sculptures at all. The sculptures can not be moved.

The first input line contains an integer n (3 ≤ n ≤ 20000) — the initial number of sculptures. The second line contains a sequence of integers t1, t2, ..., tn, ti — the degree of the i-th sculpture's attractiveness ( - 1000 ≤ ti ≤ 1000). The numbers on the line are separated by spaces.

Print the required maximum sum of the sculptures' attractiveness.

NoteIn the first sample it is best to leave every second sculpture, that is, leave sculptures with attractivenesses: 2, 4, 5 и 3.

var n=+readline();
var t=readline().split(' ').map(function(v){return+v;});
var ans=-1e9;
for(var i=3;i<=n;i++){
	if(n%i===0){
		var k=n/i;
		for(var j=0;j<k;j++){
			var sum=0;
			for(var jj=j;jj<n;jj+=k){
				sum+=t[jj];
			}
			ans=Math.max(ans,sum);
		}
	}
}
print(ans);

Array.prototype.sum = function () {
	var total = 0, i = this.length;
	while (i--) total += this[i];
	return total;
}

;(function () {
	var n = +readline(),
		t = readline().split(' ').map(Number)
		k = 1, s = t.sum();

	while ( n/++k >= 3 )
		if (! (n%k))
			for (var i = 0; i < k; i++) {
				var ns = 0;
				for (var j = i; j < n; j += k) ns += t[j];
				if (ns > s) s = ns;
			}

	print(s);

}).call(this);

var n=+readline();
var t=readline().split(' ').map(function(v){return+v;});
var ans=-1e3;
for(var i=3;i<=n;i++){
	if(n%i===0){
		var k=n/i;
		for(var j=0;j<k;j++){
			var sum=0;
			for(var jj=j;jj<n;jj+=k){
				sum+=t[jj];
			}
			ans=Math.max(ans,sum);
		}
	}
}
print(ans);

Array.prototype.sum = function () {
	var total = 0, i = this.length;
	while (i--) total += this[i];
	return total;
}

Array.prototype.frequency = function (skip, startIndex) {
	var l = this.length, ret = [];
	for (var i = startIndex; i < l; i += skip + 1) ret.push(this[i]);
	return ret;
}

;(function () {
	var n = +readline();
	var t = readline().split(' ').map(Number);

	var s = t.sum();

	if (!(n % 2) && n > 5) {
		var k = 0;
		var q = n / (k + 1);
		while ( q > 3 ) {
			if (!(q % 1)) {
				for (var i = 0; i < q/2; i++) {
					var ns = t.frequency(i, k).sum();
					if (ns > s) s = ns;
				}
			}
			q = n / (++k + 1)
		}
	}

	print(s);

}).call(this);

Array.prototype.sum = function () {
	var total = 0, i = this.length;
	while (i--) total += this[i];
	return total;
}

Array.prototype.frequency = function (skip, startIndex) {
	var l = this.length, ret = [];
	for (var i = startIndex; i < l; i += skip + 1) ret.push(this[i]);
	return ret;
}

;(function () {
	var n = +readline();
	var t = readline().split(' ').map(Number);

	var s = t.sum();

	if (!(n % 2)) {
		var k = 0;
		var q = n / (k + 1);
		while ( q > 3 ) {
			if (!(q % 1)) {
				for (var i = 0; i < q/2; i++) {
					var ns = t.frequency(i, k).sum();
					if (ns > s) s = ns;
				}
			}
			q = n / (++k + 1)
		}
	}

	print(s);

}).call(this);


You are given a string $$$s$$$ of length $$$n$$$ consisting only of lowercase Latin letters.A substring of a string is a contiguous subsequence of that string. So, string "forces" is substring of string "codeforces", but string "coder" is not.Your task is to calculate the number of ways to remove exactly one substring from this string in such a way that all remaining characters are equal (the number of distinct characters either zero or one).It is guaranteed that there is at least two different characters in $$$s$$$.Note that you can remove the whole string and it is correct. Also note that you should remove at least one character.Since the answer can be rather large (not very large though) print it modulo $$$998244353$$$.If you are Python programmer, consider using PyPy instead of Python when you submit your code.

The first line of the input contains one integer $$$n$$$ ($$$2 \le n \le 2 \cdot 10^5$$$) — the length of the string $$$s$$$. The second line of the input contains the string $$$s$$$ of length $$$n$$$ consisting only of lowercase Latin letters. It is guaranteed that there is at least two different characters in $$$s$$$.

Print one integer — the number of ways modulo $$$998244353$$$ to remove exactly one substring from $$$s$$$ in such way that all remaining characters are equal.

NoteLet $$$s[l; r]$$$ be the substring of $$$s$$$ from the position $$$l$$$ to the position $$$r$$$ inclusive.Then in the first example you can remove the following substrings:   $$$s[1; 2]$$$;  $$$s[1; 3]$$$;  $$$s[1; 4]$$$;  $$$s[2; 2]$$$;  $$$s[2; 3]$$$;  $$$s[2; 4]$$$. In the second example you can remove the following substrings:   $$$s[1; 4]$$$;  $$$s[1; 5]$$$;  $$$s[1; 6]$$$;  $$$s[1; 7]$$$;  $$$s[2; 7]$$$;  $$$s[3; 7]$$$. In the third example you can remove the following substrings:   $$$s[1; 1]$$$;  $$$s[1; 2]$$$;  $$$s[2; 2]$$$.

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

  let tmp=0, lngth=0, str='';

  rl.on('line', (input) => {
      if (tmp==0) {lngth=Number(input); tmp++;}
      else {str=input; rl.close(); therest();
    return 0;}

  });

let therest=function() {
    let uniform=true;
    for(let char of str)
    if (char!==str[0]) uniform = false;
    if (uniform==true) {
        console.log((lngth+1)*lngth/2);
        return 0;}

    let first=str[0], nmbrfirst=0, i=0;
    while (str[i]==first) {nmbrfirst++; i++;}

    let last=str[str.length-1], nmbrlast=0;
    i=str.length-1;
    while (str[i]==last) {nmbrlast++; i--;}

    if (first!==last)
       console.log((1+nmbrfirst+nmbrlast)%998244353);

    if (first==last)
        console.log(((1+nmbrfirst)*(1+nmbrlast))%998244353);
    return 0;

//console.log(str);
}
//console.log(lngth, str);}

  /*
  rl.question('What do you think of Node.js? ', (answer) => {
    // TODO: Log the answer in a database
    console.log(`Thank you for your valuable feedback: ${answer}`);

    rl.close();
  });*/

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

  let tmp=0, lngth=0, str='';

  rl.on('line', (input) => {
      if (tmp==0) {lngth=Number(input); tmp++;}
      else {str=input; rl.close(); therest();
    return 0;}

  });

let therest=function() {
    let uniform=true;
    for(let char of str)
    if (char!==str[0]) uniform = false;
    if (uniform==true) {
        console.log((lngth+1)*lngth/2);
        return 0;}

    let first=str[0], nmbrfirst=0, i=0;
    while (str[i]==first) {nmbrfirst++; i++;}

    let last=str[str.length-1], nmbrlast=0;
    i=str.length-1;
    while (str[i]==last) {nmbrlast++; i--;}

    if (first!==last)
       console.log(1+nmbrfirst+nmbrlast);

    if (first==last)
        console.log((1+nmbrfirst)*(1+nmbrlast));
    return 0;

//console.log(str);
}
//console.log(lngth, str);}

  /*
  rl.question('What do you think of Node.js? ', (answer) => {
    // TODO: Log the answer in a database
    console.log(`Thank you for your valuable feedback: ${answer}`);

    rl.close();
  });*/


You've got a robot, its task is destroying bombs on a square plane. Specifically, the square plane contains n bombs, the i-th bomb is at point with coordinates (xi, yi). We know that no two bombs are at the same point and that no bomb is at point with coordinates (0, 0). Initially, the robot is at point with coordinates (0, 0). Also, let's mark the robot's current position as (x, y). In order to destroy all the bombs, the robot can perform three types of operations:  Operation has format "1 k dir". To perform the operation robot have to move in direction dir k (k ≥ 1) times. There are only 4 directions the robot can move in: "R", "L", "U", "D". During one move the robot can move from the current point to one of following points: (x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1) (corresponding to directions). It is forbidden to move from point (x, y), if at least one point on the path (besides the destination point) contains a bomb.  Operation has format "2". To perform the operation robot have to pick a bomb at point (x, y) and put it in a special container. Thus, the robot can carry the bomb from any point to any other point. The operation cannot be performed if point (x, y) has no bomb. It is forbidden to pick a bomb if the robot already has a bomb in its container.  Operation has format "3". To perform the operation robot have to take a bomb out of the container and destroy it. You are allowed to perform this operation only if the robot is at point (0, 0). It is forbidden to perform the operation if the container has no bomb. Help the robot and find the shortest possible sequence of operations he can perform to destroy all bombs on the coordinate plane.

The first line contains a single integer n (1 ≤ n ≤ 105) — the number of bombs on the coordinate plane. Next n lines contain two integers each. The i-th line contains numbers (xi, yi) ( - 109 ≤ xi, yi ≤ 109) — the coordinates of the i-th bomb. It is guaranteed that no two bombs are located at the same point and no bomb is at point (0, 0).

In a single line print a single integer k — the minimum number of operations needed to destroy all bombs. On the next lines print the descriptions of these k operations. If there are multiple sequences, you can print any of them. It is guaranteed that there is the solution where k ≤ 106.

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		return Math.abs(a.x) + Math.abs(a.y) - Math.abs(b.x) - Math.abs(b.y);
	});
	var moves = [];
	function move(x0, y0, x1, y1) {
		if (x0 != x1) {
			moves.push('1 '+Math.abs(x0-x1)+' '+(x0 < x1 ? 'R' : 'L'));
		}
		if (y0 != y1) {
			moves.push('1 '+Math.abs(y0-y1)+' '+(y0 < y1 ? 'U' : 'D'));
		}
	}
	for (var i = 0; i < numBombs; ++i) {
		var x = bombs[i].x, y = bombs[i].y;
		move(0, 0, x, y);
		moves.push('2');
		move(x, y, 0, 0);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		if (a.y == 0 || b.y == 0) {
			if (a.y == 0 && b.y == 0) {
				return Math.abs(a.x) - Math.abs(b.x);
			}
			if (a.y == 0) {
				return -1;
			}
			return 1;
		}
		if (a.x == b.x) {
			return Math.abs(a.y) - Math.abs(b.y);
		}
		return a.x - b.x;
	});
	var moves = [];
	for (var i = 0; i < numBombs; ++i) {
		var bomb = bombs[i], x = bomb.x, y = bomb.y;
		if (x == 0) {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
			moves.push('3');
			continue;
		}
		if (x < 0) {
			var left = 'L', right = 'R';
		} else {
			var left = 'R', right = 'L';
		}
		moves.push('1 '+Math.abs(x)+' '+left);
		if (y == 0) {
			moves.push('2');
		} else {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
		}
		moves.push('1 '+Math.abs(x)+' '+right);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		if (a.y == 0 || b.y == 0) {
			if (a.y == 0 && b.y == 0) {
				return a.x - b.x;
			}
			if (a.y == 0) {
				return -1;
			}
			return 1;
		}
		if (a.x == b.x) {
			return Math.abs(a.y) - Math.abs(b.y);
		}
		return a.x - b.x;
	});
	var moves = [];
	for (var i = 0; i < numBombs; ++i) {
		var bomb = bombs[i], x = bomb.x, y = bomb.y;
		if (x == 0) {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
			moves.push('3');
			continue;
		}
		if (x < 0) {
			var left = 'L', right = 'R';
		} else {
			var left = 'R', right = 'L';
		}
		moves.push('1 '+Math.abs(x)+' '+left);
		if (y != 0) {
			moves.push('2');
		} else {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
		}
		moves.push('1 '+Math.abs(x)+' '+right);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		if (a.y == 0 || b.y == 0) {
			if (a.y == 0 && b.y == 0) {
				return a.x - b.x;
			}
			if (a.y == 0) {
				return -1;
			}
			return 1;
		}
		if (a.x != b.x) {
			return a.x - b.x;
		}
		return b.y - a.y;
	});
	var moves = [];
	for (var i = 0; i < numBombs; ++i) {
		var bomb = bombs[i], x = bomb.x, y = bomb.y;
		if (x == 0) {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
			moves.push('3');
			continue;
		} else if (x < 0) {
			var left = 'L', right = 'R';
		} else {
			var left = 'R', right = 'L';
		}
		moves.push('1 '+Math.abs(x)+' '+left);
		if (y == 0) {
			moves.push('2');
		} else {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
		}
		moves.push('1 '+Math.abs(x)+' '+right);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		if (a.y == 0 || b.y == 0) {
			if (a.y == 0 && b.y == 0) {
				return a.x - b.x;
			}
			if (a.y == 0) {
				return -1;
			}
			return 1;
		}
		if (a.x != b.x) {
			return a.x - b.x;
		}
		return a.y - b.y;
	});
	var moves = [];
	for (var i = 0; i < numBombs; ++i) {
		var bomb = bombs[i], x = bomb.x, y = bomb.y;
		if (x == 0) {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
			moves.push('3');
			continue;
		} else if (x < 0) {
			var left = 'L', right = 'R';
		} else {
			var left = 'R', right = 'L';
		}
		moves.push('1 '+Math.abs(x)+' '+left);
		if (y == 0) {
			moves.push('2');
		} else {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
		}
		moves.push('1 '+Math.abs(x)+' '+right);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		points = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		points.push({ x: x, y: y });
	}
	points.sort(function (a, b) {
		if (a.y == 0 || b.y == 0) {
			if (a.y == 0 && b.y == 0) {
				return a.x - b.x;
			}
			if (a.y == 0) {
				return a;
			}
			return b;
		}
		if (a.x != b.x) {
			return a.x - b.x;
		}
		return a.y - b.y;
	});
	var moves = [];
	for (var i = 0; i < numBombs; ++i) {
		var point = points[i], x = point.x, y = point.y;
		if (x == 0) {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
			moves.push('3');
			continue;
		} else if (x < 0) {
			var left = 'L', right = 'R';
		} else {
			var left = 'R', right = 'L';
		}
		moves.push('1 '+Math.abs(x)+' '+left);
		if (y == 0) {
			moves.push('2');
		} else {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
		}
		moves.push('1 '+Math.abs(x)+' '+right);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		if (a.y == 0 || b.y == 0) {
			if (a.y == 0 && b.y == 0) {
				return a.x - b.x;
			}
			if (a.y == 0) {
				return -1;
			}
			return 1;
		}
		if (a.x == b.x) {
			return Math.abs(a.y) - Math.abs(b.y);
		}
		return a.x - b.x;
	});
	var moves = [];
	for (var i = 0; i < numBombs; ++i) {
		var bomb = bombs[i], x = bomb.x, y = bomb.y;
		if (x == 0) {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
			moves.push('3');
			continue;
		}
		if (x < 0) {
			var left = 'L', right = 'R';
		} else {
			var left = 'R', right = 'L';
		}
		moves.push('1 '+Math.abs(x)+' '+left);
		if (y == 0) {
			moves.push('2');
		} else {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
		}
		moves.push('1 '+Math.abs(x)+' '+right);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		if (a.y == 0 || b.y == 0) {
			if (a.y == 0 && b.y == 0) {
				return a.x - b.x;
			}
			if (a.y == 0) {
				return -1;
			}
			return 1;
		}
		if (a.y != b.y) {
			return a.y - b.y;
		}
		return a.x - b.x;
	});
	var moves = [];
	for (var i = 0; i < numBombs; ++i) {
		var bomb = bombs[i], x = bomb.x, y = bomb.y;
		if (x == 0) {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
			moves.push('3');
			continue;
		} else if (x < 0) {
			var left = 'L', right = 'R';
		} else {
			var left = 'R', right = 'L';
		}
		moves.push('1 '+Math.abs(x)+' '+left);
		if (y == 0) {
			moves.push('2');
		} else {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
		}
		moves.push('1 '+Math.abs(x)+' '+right);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		if (a.y == 0 || b.y == 0) {
			if (a.y == 0 && b.y == 0) {
				return a.x - b.x;
			}
			if (a.y == 0) {
				return -1;
			}
			return 1;
		}
		if (a.x != b.x) {
			return a.x - b.x;
		}
		return Math.abs(a.y) - Math.abs(b.y);
	});
	var moves = [];
	for (var i = 0; i < numBombs; ++i) {
		var bomb = bombs[i], x = bomb.x, y = bomb.y;
		if (x == 0) {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
			moves.push('3');
			continue;
		} else if (x < 0) {
			var left = 'L', right = 'R';
		} else {
			var left = 'R', right = 'L';
		}
		moves.push('1 '+Math.abs(x)+' '+left);
		if (y == 0) {
			moves.push('2');
		} else {
			if (y > 0) {
				var up = 'U', down = 'D';
			} else {
				var up = 'D', down = 'U';
			}
			moves.push('1 '+Math.abs(y)+' '+up);
			moves.push('2');
			moves.push('1 '+Math.abs(y)+' '+down);
		}
		moves.push('1 '+Math.abs(x)+' '+right);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();

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], 10);
	};
	return tokens;
}

function main() {
	var numBombs = parseInt(readline()),
		bombs = [];
	for (var i = 0; i < numBombs; ++i) {
		var data = tokenizeIntegers(readline()),
			x = data[0], y = data[1];
		bombs.push({ x: x, y: y });
	}
	bombs.sort(function (a, b) {
		return Math.abs(a.x) + Math.abs(a.y) - Math.abs(b.x) - Math.abs(b.y);
	});
	var moves = [];
	function move(x0, y0, x1, y1) {
		if (x0 != x1) {
			moves.push('1 '+Math.abs(x0-x1)+' '+(x0 < x1 ? 'L' : 'R'));
		}
		if (y0 != y1) {
			moves.push('1 '+Math.abs(y0-y1)+' '+(y0 < y1 ? 'D' : 'U'));
		}
	}
	for (var i = 0; i < numBombs; ++i) {
		var x = bombs[i].x, y = bombs[i].y;
		move(0, 0, x, y);
		moves.push('2');
		move(x, y, 0, 0);
		moves.push('3');
	}
	print(moves.length);
	print(moves.join('\n'));
}

main();