We all know that a superhero can transform to certain other superheroes. But not all Superheroes can transform to any other superhero. A superhero with name $$$s$$$ can transform to another superhero with name $$$t$$$ if $$$s$$$ can be made equal to $$$t$$$ by changing any vowel in $$$s$$$ to any other vowel and any consonant in $$$s$$$ to any other consonant. Multiple changes can be made.In this problem, we consider the letters 'a', 'e', 'i', 'o' and 'u' to be vowels and all the other letters to be consonants.Given the names of two superheroes, determine if the superhero with name $$$s$$$ can be transformed to the Superhero with name $$$t$$$.

The first line contains the string $$$s$$$ having length between $$$1$$$ and $$$1000$$$, inclusive. The second line contains the string $$$t$$$ having length between $$$1$$$ and $$$1000$$$, inclusive. Both strings $$$s$$$ and $$$t$$$ are guaranteed to be different and consist of lowercase English letters only.

Output "Yes" (without quotes) if the superhero with name $$$s$$$ can be transformed to the superhero with name $$$t$$$ and "No" (without quotes) otherwise. You can print each letter in any case (upper or lower).

NoteIn the first sample, since both 'a' and 'u' are vowels, it is possible to convert string $$$s$$$ to $$$t$$$.In the third sample, 'k' is a consonant, whereas 'a' is a vowel, so it is not possible to convert string $$$s$$$ to $$$t$$$.

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

    var s = readline();
    var t = readline();

    var g = ['a', 'e', 'i', 'o','u'];

    if(s.length != t.length) {
        print('no');
        return;
    }

    for(var i = 0; i < s.length; i++) {
        if((g.indexOf(s[i]) < 0 && g.indexOf(t[i]) >= 0) || (g.indexOf(s[i]) >= 0 && g.indexOf(t[i]) <0 )) {
            print('no');
            return;
        }
    }

    print('yes');

}());

var l1 = readline();
var l2 = readline();

var glas = ['a', 'e', 'i', 'o', 'u'];
var res = 'Yes';

if (l1.length != l2.length) {
    res = 'No';
} else {
    for(var i=0; i<l1.length; i++) {
        var tmp1 = glas.indexOf(l1[i]);
        var tmp2 = glas.indexOf(l2[i]);
        if((tmp1 == -1 && tmp2 == -1) || (tmp1 > -1 && tmp2 > -1)) {
            continue;
        } else {
            res = 'No';
            break;
        }
    }
}
print(res);

var s = readline();
var t = readline();

gl_count = function(st) {
	var ans = 0;
	for (var i=0; i<st.length; i++)
		ans += ['a','e','i','o','u'].indexOf(st[i]) >= 0;
	return ans;
}

var s_gl = gl_count(s);
var t_gl = gl_count(t);

if (s_gl === t_gl && s.length === t.length) {
	var Ok = 1;
	for (var i=0; i<s.length; i++)
	    if ((['a','e','i','o','u'].indexOf(s[i]) >= 0 &&
	         ['a','e','i','o','u'].indexOf(t[i]) < 0) ||
	         (['a','e','i','o','u'].indexOf(t[i]) >= 0 &&
	         ['a','e','i','o','u'].indexOf(s[i]) < 0))
	         Ok = 0;
	if (Ok === 1)
	    print("Yes");
	else
	    print("No");
}
else
	print("No");

var v = {}
v['a'] = 1
v['e'] = 1
v['i'] = 1
v['o'] = 1
v['u'] = 1

function check(v) {
    if (v==='a') { return 1; }
    if (v==='e') { return 1; }
    if (v==='i') { return 1; }
    if (v==='o') { return 1; }
    if (v==='u') { return 1; }
    return 0;
}

var vc1 = 0, vc2 = 0;

var a = readline()
var b = readline()

if (a.length === b.length) {

    var pass = true;
    a.split('').forEach((c, i)=>{

        if(v[a[i]] !== v[b[i]]) {
            pass = false;
        }
    })

    if (pass) {
        print('Yes')
    } else {
        print('No')
    }
} else {
    print('No')
}

const s = readline();
const t = readline();

var output = 'Yes';

if (s.length !== t.length) {
    output = 'No';
} else {
    for (var i = 0; i < s.length; i++) {
        var sb1 = isSb(s[i]);
        var sb2 = isSb(t[i]);

        if (sb1 !== sb2) {
            output = 'No';
            break;
        }
    }
}

print(output);

function isSb(ch) {
    return !!~'aeiou'.indexOf(ch);
}

//var input = readline()

var a = readline()
var b = readline()

var L1 = a.length
var L2 = b.length

var k = /[aeiou]/g
var o = /[^aeiou1]/g

var n = a.replace(k, '1')
var m = b.replace(k, '1')

var x = n.replace(o, '0')
var y = m.replace(o, '0')
//print('x = '+x +' '+ y)

if(L1 != L2) print("No")
else {
    if(x == y) print("Yes")
    else print("No")
}

//

// run on javascript V8 4.8.0

function main() {
  var s = readline();
  var t = readline();

  var ans = solve(s, t);
  print(ans);
}

function solve(s, t) {
  // https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp

  const c = /[^aeiou]/g;
  const v = /[aeiou]/g;
  const normalizedS = s.replace(c, 'C').replace(v, 'V');
  const normalizedT = t.replace(c, 'C').replace(v, 'V');
  if (normalizedS === normalizedT) {
    return 'Yes';
  } else {
    return 'No';
  }
}

main();

function q(c)
{
    if (c==='a')
        return 1;
    if (c==='o')
        return 1;
    if (c==='u')
        return 1;
    if (c==='i')
        return 1;
    if (c==='e')
        return 1;
    return 0;
}

function main() {
    s=stdin[0]
    t=stdin[1]
    if (s.length!=t.length)
    {
        console.log("No")
    }
    else
    {
        ans="Yes"
        for (i=0;i<s.length;i++)
        {
            if (q(s[i])!==q(t[i]))
            {
                ans="No"
            }
        }
        console.log(ans)
    }
}

const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
var stdin = [];
rl.on('line', function (line) {stdin.push(line);});
rl.on('close', main);

function test() {
  assert(task(['a', 'u']), 'Yes');
  assert(task(['abc', 'ukm']), 'Yes');
  assert(task(['bbb', 'abb']), 'No');
}

function task([l1, l2]) {
  if (l1.length !== l2.length) {
    return 'No';
  }

  const isVowel = c => c === 'a' || c === 'e' || c === 'i' || c === 'o' || c === 'u';

  for (let i = 0; i < l1.length; i++) {
    if (isVowel(l1[i]) && isVowel(l2[i])) continue;
    if (!isVowel(l1[i]) && !isVowel(l2[i])) continue;
    return 'No';
  }

  return 'Yes';
}

function assert(result, expectation, unordered) {
  if (unordered) {
    result = result.split(' ');
    expectation = expectation.split(' ');

    if (result.sort().join(' ') !== expectation.sort().join(' ')) {
      console.error(`${result}: ${expectation}`);
    }
  } else if (result !== expectation) {
    console.error(`${result}: ${expectation}`);
  }
}

function run() {
  // codeforces uses windows. Really??!
  if (process.platform === 'win32') {
    const readline = require('readline');
    const rl = readline.createInterface({ input: process.stdin });

    const input = [];

    rl.on('line', (line) => input.push(line));
    rl.on('close', () => console.log(task(input)));
  } else {
    test();
  }
}

run();

const readline = require('readline');

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

function readLines(number, cb) {
    const lines = [];
    rl.on('line', function(line) {
        lines.push(line);
        if (lines.length === number) {
            rl.close();
            cb(lines);
        }
    });
};

function readLines(number, cb) {
    const lines = [];
    rl.on('line', function(line) {
        lines.push(line);
        if (lines.length === number) {
            rl.close();
            cb(lines);
        }
    });
};

function doIt(lines) {
    const first = lines[0]
    const second = lines[1]

    if (first.length!=second.length) {
        console.log('No');
    } else {
        let same = true;
        for (let i=0; i<first.length && same; i++) {
            same = isSame(first[i], second[i])
        }
        if (same)
            console.log('Yes')
        else
            console.log('No')
    }

    function isSame(f, s) {
        let isfv = isVowel(f);
        let issv = isVowel(s)

        return isfv === issv;
    }

    function isVowel(a) {
        if (a === 'a' || a == 'e' || a=='i' || a=='o' || a=='u')
            return 1;
        else
            return 0;
    }
}

readLines(2, doIt);

function getAnswer() {
    const fs = require('fs');
    const stdinBuffer = fs.readFileSync(0).toString('utf8');
    const [s, t] = stdinBuffer.split('\n').map((str) => str.trim());
    const vowel = new Set(['a', 'e', 'i', 'o', 'u']);
    const sL = s.length;
    const tL = t.length;

    if (sL !== tL) {
        return false;
    }

    for (let i = 0; i < sL; i++) {
        if (vowel.has(s[i]) ^ vowel.has(t[i])) {
            return false;
        }
    }

    return true;
}

console.log(getAnswer() ? 'Yes' : 'No');

// node.js 9.4.0

function main() {
  const readline = require('readline');
  const rl = readline.createInterface({ input: process.stdin });
  const io = consoleIo();
  io.next();
  rl.on('line', (line) => io.next(line));
  rl.on('close', () => io.next());
}

function* consoleIo() {
  const s = yield 0;
  const t = yield 0;

  const ans = solve(s, t);

  console.log(ans);
}

function solve(s, t) {
  // https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp

  const c = /[^aeiou]/g
  const v = /[aeiou]/g
  const normalizedS = s.replace(c, 'C').replace(v, 'V');
  const normalizedV = t.replace(c, 'C').replace(v, 'V');
  if (normalizedS === normalizedV) {
    return 'Yes'
  } else {
    return 'No';
  }
}

main();

// node.js 9.4.0

function main() {
  const readline = require('readline');
  const rl = readline.createInterface({ input: process.stdin });
  const io = consoleIo();
  io.next();
  rl.on('line', (line) => io.next(line));
  rl.on('close', () => io.next());
}

function* consoleIo() {
  const s = yield 0;
  const t = yield 0;

  const ans = solve(s, t);
  console.log(ans);
}

function solve(s, t) {
  // https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp

  const c = /[^aeiou]/g;
  const v = /[aeiou]/g;
  const normalizedS = s.replace(c, 'C').replace(v, 'V');
  const normalizedV = t.replace(c, 'C').replace(v, 'V');
  if (normalizedS === normalizedV) {
    return 'Yes';
  } else {
    return 'No';
  }
}

main();

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

    var s = readline();
    var t = readline();

    var g = ['a', 'e', 'i', 'o','u'];

    for(var i = 0; i < s; i++) {
        if((g.indexOf(s[i]) < 0 && g.indexOf(t[i]) >= 0) ||  (g.indexOf(s[i]) >= 0 && g.indexOf(t[i]) <0 )) {
            print('no');
            return;
        }
    }

    return 'Yes';

}());

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

    var s = readline();
    var t = readline();

    var g = ['a', 'e', 'i', 'o','u'];

    if(s.length != t.length) {
        print('no');
        return;
    }

    for(var i = 0; i < s; i++) {
        if((g.indexOf(s[i]) < 0 && g.indexOf(t[i]) >= 0) ||  (g.indexOf(s[i]) >= 0 && g.indexOf(t[i]) < 0)) {
            print('no');
            return;
        }
    }

    print('Yes');

}());

// var v = {}
// v['a'] = 1
// v['e'] = 1
// v['i'] = 1
// v['o'] = 1
// v['u'] = 1

function check(v) {
    if (v==='a') { return 1; }
    if (v==='e') { return 1; }
    if (v==='i') { return 1; }
    if (v==='o') { return 1; }
    if (v==='u') { return 1; }
    if (v==='y') { return 1; }
    return 0;
}

var vc1 = 0, vc2 = 0;

var a = readline()
var b = readline()

if (a.length === b.length) {
    a.split('').forEach((c)=>{
        vc1 += check(c);
    })

    b.split('').forEach((c)=>{
        vc2 += check(c);
    })

    if (vc1 === vc2) {
        print('Yes')
    } else {
        print('No')
    }
} else {
    print('No')
}

// var v = {}
// v['a'] = 1
// v['e'] = 1
// v['i'] = 1
// v['o'] = 1
// v['u'] = 1

function check(v) {
    if (v==='a') { return 1; }
    if (v==='e') { return 1; }
    if (v==='i') { return 1; }
    if (v==='o') { return 1; }
    if (v==='u') { return 1; }
    return 0;
}

var vc1 = 0, vc2 = 0;

var a = readline()
var b = readline()

if (a.length === b.length) {
    a.split('').forEach((c)=>{
        vc1 += check(c);
    })

    b.split('').forEach((c)=>{
        vc2 += check(c);
    })

    if (vc1 === vc2) {
        print('Yes')
    } else {
        print('No')
    }
} else {
    print('No')
}

// node.js 9.4.0

function main() {
  const readline = require('readline');
  const rl = readline.createInterface({ input: process.stdin });
  const io = consoleIo();
  io.next();
  rl.on('line', (line) => io.next(line));
  rl.on('close', () => io.next());
}

function* consoleIo() {
  const s = yield 0;
  const t = yield 0;

  const ans = solve(s, t);

  console.log(ans);
}

function solve(s, t) {
  // https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp

  const c = /[^aeiou]/g
  const v = /[aeiou]/g
  const normalizedS = s.replace(c, 'C').replace(v, 'V');
  const normalizedV = t.replace(c, 'C').replace(v, 'V');
  console.log(normalizedS);
  console.log(normalizedV);
  if (normalizedS === normalizedV) {
    return 'Yes'
  } else {
    return 'No';
  }
}

main();


There are n cities and m two-way roads in Berland, each road connects two cities. It is known that there is no more than one road connecting each pair of cities, and there is no road which connects the city with itself. It is possible that there is no way to get from one city to some other city using only these roads.The road minister decided to make a reform in Berland and to orient all roads in the country, i.e. to make each road one-way. The minister wants to maximize the number of cities, for which the number of roads that begins in the city equals to the number of roads that ends in it.

The first line contains a positive integer t (1 ≤ t ≤ 200) — the number of testsets in the input. Each of the testsets is given in the following way. The first line contains two integers n and m (1 ≤ n ≤ 200, 0 ≤ m ≤ n·(n - 1) / 2) — the number of cities and the number of roads in Berland.  The next m lines contain the description of roads in Berland. Each line contains two integers u and v (1 ≤ u, v ≤ n) — the cities the corresponding road connects. It's guaranteed that there are no self-loops and multiple roads. It is possible that there is no way along roads between a pair of cities. It is guaranteed that the total number of cities in all testset of input data doesn't exceed 200. Pay attention that for hacks, you can only use tests consisting of one testset, so t should be equal to one.

For each testset print the maximum number of such cities that the number of roads that begins in the city, is equal to the number of roads that ends in it. In the next m lines print oriented roads. First print the number of the city where the road begins and then the number of the city where the road ends. If there are several answers, print any of them. It is allowed to print roads in each test in arbitrary order. Each road should be printed exactly once.

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

var arr = [];

var nodes;

var rs_obj = [];

for (var k = 0;k < len;k ++) {
	var _arr = readline().split(' ');

	var rs = 0;

	var N = Number(_arr[0]),
		M = Number(_arr[1]),
		lines = [];
	for (var i = 0;i < M;i ++) {
		_arr = readline().split(' ');
		var line_obj = {
			start: Number(_arr[0]),
			end: Number(_arr[1])
		};
		lines.push(line_obj);
	}
	nodes = {};
	for (var i = 0;i < lines.length;i ++) {
		var start_id = lines[i].start,
			end_id = lines[i].end;
		if (nodes[start_id] == null) {
			nodes[start_id] = [];
		}
		if (nodes[end_id] == null) {
			nodes[end_id] = [];
		}

		if (nodes[start_id].indexOf(end_id) == -1) {
			nodes[start_id].push(end_id);
		}
		if (nodes[end_id].indexOf(start_id) == -1) {
			nodes[end_id].push(start_id);
		}
	}
	nodes[N + 1] = [];
	for (var key = 1;key <= N;key ++) {
		var _line = nodes[key];
		if (_line && _line.length % 2 == 1) {
			_line.push(N + 1);
			nodes[N + 1].push(key);
			rs ++;
		}
	}
	rs_obj = [];
	for (var i = 1;i <= N;i ++) {
		if (nodes[i] != null) {
			dfs(i);
		}
	}
	print(N - rs);
	for (var i = 0;i < rs_obj.length;i ++) {
		var s = rs_obj[i].start;
		var e = rs_obj[i].end;
		if (s != N + 1 && e != N + 1) {
			print(s + " " + e);
		}
	}
}

function dfs (_index) {
	while(nodes[_index].length > 0) {
		var city_id = nodes[_index].pop();
		var obj = {
			start: _index,
			end: city_id
		};
		rs_obj.push(obj);
		var __index = nodes[city_id].indexOf(_index);
		if (__index != -1) {
			nodes[city_id].splice(__index, 1);
		}
		dfs(city_id);
	}
}

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

var arr = [];

var nodes;

var rs_obj = [];

for (var k = 0;k < len;k ++) {
	var _arr = readline().split(' ');

	var rs = 0;

	var N = Number(_arr[0]),
		M = Number(_arr[1]),
		lines = [];
	for (var i = 0;i < M;i ++) {
		_arr = readline().split(' ');
		var line_obj = {
			start: Number(_arr[0]),
			end: Number(_arr[1])
		};
		lines.push(line_obj);
	}
	nodes = {};
	for (var i = 0;i < lines.length;i ++) {
		var start_id = lines[i].start,
			end_id = lines[i].end;
		if (nodes[start_id] == null) {
			nodes[start_id] = [];
		}
		if (nodes[end_id] == null) {
			nodes[end_id] = [];
		}

		if (nodes[start_id].indexOf(end_id) == -1) {
			nodes[start_id].push(end_id);
		}
		if (nodes[end_id].indexOf(start_id) == -1) {
			nodes[end_id].push(start_id);
		}
	}
	nodes[N + 1] = [];
	for (var key = 1;key <= N;key ++) {
		var _line = nodes[key];
		if (_line && _line.length % 2 == 1) {
			_line.push(N + 1);
			nodes[N + 1].push(key);
			rs ++;
		}
	}
	rs_obj = [];
	for (var i = 1;i <= N;i ++) {
		if (nodes[i] != null) {
			dfs(i);
		}
	}
	print(rs);
	for (var i = 0;i < rs_obj.length;i ++) {
		var s = rs_obj[i].start;
		var e = rs_obj[i].end;
		if (s != N + 1 && e != N + 1) {
			print(s + " " + e);
		}
	}
}

function dfs (_index) {
	while(nodes[_index].length > 0) {
		var city_id = nodes[_index].pop();
		var obj = {
			start: _index,
			end: city_id
		};
		rs_obj.push(obj);
		var __index = nodes[city_id].indexOf(_index);
		if (__index != -1) {
			nodes[city_id].splice(__index, 1);
		}
		dfs(city_id);
	}
}

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

var arr = [];

var nodes;

var rs_obj = [];

for (var k = 0;k < len;k ++) {
	var _arr = readline().split(' ');

	var rs = 0;

	var N = Number(_arr[0]),
		M = Number(_arr[1]),
		lines = [];
	for (var i = 0;i < M;i ++) {
		_arr = readline().split(' ');
		var line_obj = {
			start: Number(_arr[0]),
			end: Number(_arr[1])
		};
		lines.push(line_obj);
	}
	nodes = {};
	for (var i = 0;i < lines.length;i ++) {
		var start_id = lines[i].start,
			end_id = lines[i].end;
		if (nodes[start_id] == null) {
			nodes[start_id] = [];
		}
		if (nodes[end_id] == null) {
			nodes[end_id] = [];
		}

		if (nodes[start_id].indexOf(end_id) == -1) {
			nodes[start_id].push(end_id);
		}
		if (nodes[end_id].indexOf(start_id) == -1) {
			nodes[end_id].push(start_id);
		}
	}
	nodes[N + 1] = [];
	for (var key in nodes) {
		var _line = nodes[key];
		if (_line.length % 2 == 1 && key != N + 1) {
			_line.push(N + 1);
			nodes[N + 1].push(key);
			rs ++;
		}
	}
	rs_obj = [];
	for (var i = 1;i <= N;i ++) {
		if (nodes[i] != null) {
			dfs(i);
		}
	}
	print(rs);
	for (var i = 0;i < rs_obj.length;i ++) {
		var s = rs_obj[i].start;
		var e = rs_obj[i].end;
		if (s != N + 1 && e != N + 1) {
			print(s + " " + e);
		}
	}
}

function dfs (_index) {
	while(nodes[_index].length > 0) {
		var city_id = nodes[_index].pop();
		var obj = {
			start: _index,
			end: city_id
		};
		rs_obj.push(obj);
		var __index = nodes[city_id].indexOf(_index);
		if (__index != -1) {
			nodes[city_id] = nodes[city_id].splice(__index, 1);
		}
		dfs(city_id);
	}
}

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

var arr = [];

var nodes;

var rs_obj = [];

for (var k = 0;k < len;k ++) {
	var _arr = readline().split(' ');

	var rs = 0;

	var N = Number(_arr[0]),
		M = Number(_arr[1]),
		lines = [];
	for (var i = 0;i < M;i ++) {
		_arr = readline().split(' ');
		var line_obj = {
			start: Number(_arr[0]),
			end: Number(_arr[1])
		};
		lines.push(line_obj);
	}
	nodes = {};
	for (var i = 0;i < lines.length;i ++) {
		var start_id = lines[i].start,
			end_id = lines[i].end;
		if (nodes[start_id] == null) {
			nodes[start_id] = [];
		}
		if (nodes[end_id] == null) {
			nodes[end_id] = [];
		}

		if (nodes[start_id].indexOf(end_id) == -1) {
			nodes[start_id].push(end_id);
		}
		if (nodes[end_id].indexOf(start_id) == -1) {
			nodes[end_id].push(start_id);
		}
	}
	nodes[N + 1] = [];
	for (var key in nodes) {
		var _line = nodes[key];
		if (_line.length % 2 == 1) {
			_line.push(N + 1);
			nodes[N + 1].push(key);
			rs ++;
		}
	}
	rs_obj = [];
	for (var i = 1;i <= N;i ++) {
		if (nodes[i] != null) {
			dfs(i);
		}
	}
	print(rs);
	for (var i = 0;i < rs_obj.length;i ++) {
		var _str = rs_obj[i].start + " " + rs_obj[i].end;
		print(_str);
	}
}

function dfs (_index) {
	while(nodes[_index].length > 0) {
		var city_id = nodes[_index].pop();
		var obj = {
			start: _index,
			end: city_id
		};
		rs_obj.push(obj);
		var __index = nodes[city_id].indexOf(_index);
		if (__index != -1) {
			nodes[city_id] = nodes[city_id].splice(__index, 1);
		}
		dfs(city_id);
	}
}


You are given two strings $$$s$$$ and $$$t$$$. In a single move, you can choose any of two strings and delete the first (that is, the leftmost) character. After a move, the length of the string decreases by $$$1$$$. You can't choose a string if it is empty.For example:  by applying a move to the string "where", the result is the string "here",  by applying a move to the string "a", the result is an empty string "". You are required to make two given strings equal using the fewest number of moves. It is possible that, in the end, both strings will be equal to the empty string, and so, are equal to each other. In this case, the answer is obviously the sum of the lengths of the initial strings.Write a program that finds the minimum number of moves to make two given strings $$$s$$$ and $$$t$$$ equal.

The first line of the input contains $$$s$$$. In the second line of the input contains $$$t$$$. Both strings consist only of lowercase Latin letters. The number of letters in each string is between 1 and $$$2\cdot10^5$$$, inclusive.

Output the fewest number of moves required. It is possible that, in the end, both strings will be equal to the empty string, and so, are equal to each other. In this case, the answer is obviously the sum of the lengths of the given strings.

NoteIn the first example, you should apply the move once to the first string and apply the move once to the second string. As a result, both strings will be equal to "est".In the second example, the move should be applied to the string "codeforces" $$$8$$$ times. As a result, the string becomes "codeforces" $$$\to$$$ "es". The move should be applied to the string "yes" once. The result is the same string "yes" $$$\to$$$ "es".In the third example, you can make the strings equal only by completely deleting them. That is, in the end, both strings will be empty.In the fourth example, the first character of the second string should be deleted.

s=readline()
t=readline()
n=s.length
m=t.length
res=0
if (n<m)
{
    t=t.substring(m-n)
    res+=m-n
    m=n
}
if (n>m)
{
    s=s.substring(n-m)
    res+=n-m
    n=m
}
i=n-1
res+=2*n
while(i>=0&&s[i]==t[i])
{
    --i
    res-=2
}
print(res)

var firstLine = readline();
var secondLine = readline();
var firstLineA = firstLine;
var secondLineA = secondLine;
var result = 0;
var temp1 = 0;
var temp2 = 0;

if (firstLine[firstLine.length - 1] !== secondLine[secondLine.length - 1]) {
    print(firstLine.length + secondLine.length);
} else {
    if (firstLine.length > secondLine.length) {
        result = firstLine.length - secondLine.length;
        firstLine = firstLine.slice(result);
    } else if (firstLine.length < secondLine.length) {
        result = secondLine.length - firstLine.length;
        secondLine = secondLine.slice(result);
    }

    var i = firstLine.length - 1;
    for (; i > -1; i--) {
        if (firstLine[i] !== secondLine[i]) {
            break;
        } else {
            temp1 += 2;
        }
    }

    print(result + firstLine.length*2 - temp1);
}

var s = readline();
var t = readline();

// console.log(s);

var slen = s.length;
var tlen = t.length;

var ans = slen + tlen;
var mn = Math.min(slen,tlen);

var equal = 0;
for(var i = 0;i<mn;i++){
    if(s[slen-i-1] === t[tlen-i-1] ){
        equal++;
    }
    else {
        break;
    }
}
print(ans-(2*equal));

/*var s = readline();
var t = readline();

var slength = s.length;
var tlength = t.length;

var minLength = Math.min(slength, tlength);
var equal = 0;
for(var i = 0; i < minLength; i++) {
    if(s[s.length - 1 - i] === t[t.length - 1 - i]) {
        equal++;
    } else {
        break;
    }
}
print(s.length + t.length - 2 * equal);*/

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

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

  str2 = d;

  c++;
});

rl.on('close', () => {
  const arr1 = [...str1].reverse();
  const arr2 = [...str2].reverse();
  let count = 0;

  for (let i = 0; i < arr1.length; i++) {
    if (arr1[i] === arr2[i]) {
      count++;
    }
    else {
      break;
    }
  }

  const ans = (arr1.length + arr2.length) - (count * 2);
  console.log(ans);
});

var k = readline();
var x = readline();
b=k.length;
a=x.length;
y=1;
if (k == x){
    print(0);
}
else {
while ( k[b-y] == x[a-y]){
    y++;
}
print((b-y+1) + (a-y+1));}

var s = readline();
var t = readline();
var reversedS = s.split("").reverse();
var reversedT = t.split("").reverse();
var sLength = reversedS.length;
var tLength = reversedT.length;

var maxLength = Math.max(sLength, tLength);

var similarCount = 0;
for (var i = 0; i < maxLength; i ++) {
  if (i < sLength && i < tLength) {
    if (reversedS[i] === reversedT[i]) {
      similarCount ++;
    } else { break; }
  } else { break ;}
}

write(sLength + tLength - similarCount * 2);

var firstLine = readline();
var secondLine = readline();
var firstLineA = firstLine;
var secondLineA = secondLine;
var result = 0;
var temp1 = 0;
var temp2 = 0;

if (firstLine[firstLine.length - 1] !== secondLine[secondLine.length - 1]) {
    print(firstLine.length + secondLine.length);
} else {
    if (firstLine.length > secondLine.length) {
        result = firstLine.length - secondLine.length;
        firstLine = firstLine.slice(result);
    } else if (firstLine.length < secondLine.length) {
        result = secondLine.length - firstLine.length;
        secondLine = secondLine.slice(result);
    }

    var i = 0;
    for (; i < firstLine.length; i++) {
        if (firstLine[i] !== secondLine[i]) {
            result += 2;
            continue;
        } else {
            break;
        }
    }

    print(result);
}

var firstLine = readline();
var secondLine = readline();
var firstLineA = firstLine;
var secondLineA = secondLine;
var result = 0;
var temp1 = 0;
var temp2 = 0;

if (firstLine[firstLine.length - 1] !== secondLine[secondLine.length - 1]) {
    print(firstLine.length + secondLine.length);
} else {
    if (firstLine.length > secondLine.length) {
        result = firstLine.length - secondLine.length;
        firstLine = firstLine.slice(result);
    } else if (firstLine.length < secondLine.length) {
        result = secondLine.length - firstLine.length;
        secondLine = secondLine.slice(result);
    }

    temp1 = Math.floor(firstLine.length / 2);
    while (true) {
        if (firstLine[temp1] !== secondLine[temp1]) {
            firstLine = firstLine.slice(temp1 + 1);
            secondLine = secondLine.slice(temp1 + 1);
            temp1 += Math.floor(temp1 / 2) + 1;
        } else {
            if (temp1 === 0) break;
            temp1 -= Math.floor(temp1 / 2) + 1;
        }

        if (firstLine === secondLine) break;
    }

    result = firstLineA.length - firstLine.length + secondLineA.length - secondLine.length;
    print(result);
}

var k = readline();
var x = readline();
b=k.length;
a=x.length;

k='.'+k;
x=','+x;

y=1;
while ( k[b-y] == x[a-y]){
    y++;
}
print((b-y) + (a-y));

// kol_vo=0;
// while (firstVar!=secondVar){
// 	kol_vo=kol_vo+1;
// 	firstVar=firstVar-1;
// 	if (firstVar===secondVar) {
// 		break
// 	}
// 	else {
// 	secondVar=secondVar-1; }
// }

/*
    Coded by RuX
*/
var readline = require('readline');
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
var leftstring = function (s1, s2) {
    var max = "";
    var min = "";
    if (s1.length > s2.length) {
        max = s1;
        min = s2;
    }
    else {
        max = s2;
        min = s1;
    }
    var match = new RegExp("(?:[" + min + "]+)$", "gm");
    var con = match.exec(max);
    var sub = "";
    if (con != null) {
        sub = con[0];
    }
    else {
        sub = "";
    }
    var result = max.length + min.length - 2 * sub.length;
    return result;
};
var s1 = "";
var s2 = "";
var c = 0;
rl.on('line', function (line) {
    c += 1;
    if (c == 1) {
        s1 = line;
    }
    else {
        s2 = line;
        rl.close();
        console.log(leftstring(s1, s2));
    }
});

var k = readline();
var x = readline();
b=k.length;
a=x.length;

k='.'+k;
x=','+x;

y=1;
while ( k[b-y] === x[a-y]){
    y++;
}
print(b-y+1 + a-y+1);

// kol_vo=0;
// while (firstVar!=secondVar){
// 	kol_vo=kol_vo+1;
// 	firstVar=firstVar-1;
// 	if (firstVar===secondVar) {
// 		break
// 	}
// 	else {
// 	secondVar=secondVar-1; }
// }

var k = readline();
var x = readline();
b=k.length;
a=x.length;

k='.'+k;
x=','+x;

y=1;
if (k == x){
    print(0);
}
else {
while ( k[b-y] == x[a-y]){
    y++;
}
print((b-y+1) + (a-y+1));}

var k = readline();
var x = readline();
b=k.length;
a=x.length;

k='.'+k;
x=','+x;

y=1;
while ( k[b-y] === x[a-y]){
    y++;
}
print(b-y + a-y);

// kol_vo=0;
// while (firstVar!=secondVar){
// 	kol_vo=kol_vo+1;
// 	firstVar=firstVar-1;
// 	if (firstVar===secondVar) {
// 		break
// 	}
// 	else {
// 	secondVar=secondVar-1; }
// }


Gabriella has been instructed to organize a renowned wine tasting event which will be attended by $$$m$$$ critics. On display, there will be $$$n$$$ different varieties of wine, each of which can either be a red wine or a white wine.The wines will come in $$$n$$$ bottles arranged in a line on the table, and, for convenience, each critic will sip from a contiguous interval of bottles: that is, he/she will taste exactly the bottles at position $$$a, \, a + 1, \, \dots, \, b$$$ for some $$$1 \le a \le b \le n$$$. The interval depends on the critic, who will select it on the spot according to their preferences. In fact, the $$$i$$$-th critic ($$$1 \le i \le m$$$) has requested that he/she wants to taste exactly $$$r_i$$$ red wines and $$$w_i$$$ white wines.Gabriella has yet to choose how many bottles of red wine and white wine there will be, and in what order they will appear. Help her find an arrangement (that is, a sequence of $$$n$$$ bottles of either red or white wine) that satisfies the requests of all the critics, or state that no such arrangement exists.

Each test contains multiple test cases. The first line contains an integer $$$t$$$ ($$$1\le t\le 100$$$) — the number of test cases. The descriptions of the $$$t$$$ test cases follow. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 100$$$, $$$1 \le m \le 100$$$) — the number of bottles of wine and the number of critics. Each of the next $$$m$$$ lines contains two integers $$$r_i$$$ and $$$w_i$$$ ($$$0 \le r_i, \, w_i \le 100$$$, $$$r_i + w_i \ge 1$$$) — the number of red and white wines that the $$$i$$$-th critic wants to taste.

For each test case, if at least one solution exists, print a string of length $$$n$$$ made up of the characters R and W, where the $$$j$$$-th character ($$$1 \le j \le n$$$) denotes the type of the wine in the $$$j$$$-th bottle of the arrangement (R for red and W for white). If there are multiple solutions, print any. If no solution exists, print the string IMPOSSIBLE.

NoteIn the first test case, there are $$$n = 5$$$ bottles of wine to be arranged and $$$m = 3$$$ critics. The arrangement RWRRW satisfies the requests of all three critics. Indeed:   the first critic can choose the interval $$$[3, \, 3]$$$, which contains exactly one bottle of red wine (note that $$$[1, \, 1]$$$ and $$$[4, \, 4]$$$ are other valid choices);  the second critic can choose the interval $$$[1, \, 5]$$$, which contains $$$3$$$ bottles of red wine and $$$2$$$ bottles of white wine;  the third critic can choose the interval $$$[2, \, 5]$$$, which contains $$$2$$$ bottles of red wine and $$$2$$$ bottles of white wine.

'use strict';

var readline = require('readline');

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

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function solve(n, m, a) {
  let rr = 0,
      ww = 0;
  a.sort((a, b) => a[0] + a[1] - b[0] - b[1]);
  for (let [r, w] of a) {
    rr = Math.max(rr, r);
    ww = Math.max(ww, w);
  }
  if (rr + ww > n) {
    console.log('IMPOSSIBLE');
  } else {
    console.log('R'.repeat(rr) + 'W'.repeat(ww) + 'W'.repeat(n - rr - ww));
  }
}

async function main(read) {
  let t = Number(await read());
  while (t--) {
    const [n, m] = (await read()).split(' ').map(Number);
    const a = [];
    let tmp = m;
    while (tmp--) {
      a.push((await read()).split(' ').map(Number));
    }
    solve(n, m, a);
  }
}

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
void async function () {
  const inputs = [];
  let i = 0;
  for await (const line of rl) {
    inputs.push(line.trim());
  }
  function read() {
    return inputs[i++];
  }
  await main(read);
}();

'use strict';

var readline = require('readline');

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

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function solve(n, m, a) {
  let rr = 0,
      ww = 0;
  a.sort((a, b) => a[0] + a[1] - b[0] - b[1]);
  for (let [r, w] of a) {
    rr = Math.max(rr, r);
    ww = Math.max(ww, w);
  }
  if (rr + ww > n) {
    console.log('IMPOSSIBLE');
  } else {
    console.log('R'.repeat(rr) + 'W'.repeat(ww));
  }
}

async function main(read) {
  let t = Number(await read());
  while (t--) {
    const [n, m] = (await read()).split(' ').map(Number);
    const a = [];
    let tmp = m;
    while (tmp--) {
      a.push((await read()).split(' ').map(Number));
    }
    solve(n, m, a);
  }
}

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
void async function () {
  const inputs = [];
  let i = 0;
  for await (const line of rl) {
    inputs.push(line.trim());
  }
  function read() {
    return inputs[i++];
  }
  await main(read);
}();


Frodo was caught by Saruman. He tore a pouch from Frodo's neck, shook out its contents —there was a pile of different rings: gold and silver..."How am I to tell which is the One?!" the mage howled."Throw them one by one into the Cracks of Doom and watch when Mordor falls!" Somewhere in a parallel Middle-earth, when Saruman caught Frodo, he only found $$$n$$$ rings. And the $$$i$$$-th ring was either gold or silver. For convenience Saruman wrote down a binary string $$$s$$$ of $$$n$$$ characters, where the $$$i$$$-th character was 0 if the $$$i$$$-th ring was gold, and 1 if it was silver.Saruman has a magic function $$$f$$$, which takes a binary string and returns a number obtained by converting the string into a binary number and then converting the binary number into a decimal number. For example, $$$f(001010) = 10, f(111) = 7, f(11011101) = 221$$$.Saruman, however, thinks that the order of the rings plays some important role. He wants to find $$$2$$$ pairs of integers $$$(l_1, r_1), (l_2, r_2)$$$, such that: $$$1 \le l_1 \le n$$$, $$$1 \le r_1 \le n$$$, $$$r_1-l_1+1\ge \lfloor \frac{n}{2} \rfloor$$$  $$$1 \le l_2 \le n$$$, $$$1 \le r_2 \le n$$$, $$$r_2-l_2+1\ge \lfloor \frac{n}{2} \rfloor$$$  Pairs $$$(l_1, r_1)$$$ and $$$(l_2, r_2)$$$ are distinct. That is, at least one of $$$l_1 \neq l_2$$$ and $$$r_1 \neq r_2$$$ must hold. Let $$$t$$$ be the substring $$$s[l_1:r_1]$$$ of $$$s$$$, and $$$w$$$ be the substring $$$s[l_2:r_2]$$$ of $$$s$$$. Then there exists non-negative integer $$$k$$$, such that $$$f(t) = f(w) \cdot k$$$.Here substring $$$s[l:r]$$$ denotes $$$s_ls_{l+1}\ldots s_{r-1}s_r$$$, and $$$\lfloor x \rfloor$$$ denotes rounding the number down to the nearest integer.Help Saruman solve this problem! It is guaranteed that under the constraints of the problem at least one solution exists.

Each test contains multiple test cases. The first line contains one positive integer $$$t$$$ ($$$1 \le t \le 10^3$$$), denoting the number of test cases. Description of the test cases follows. The first line of each test case contains one positive integer $$$n$$$ ($$$2 \le n \le 2 \cdot 10^4$$$) — length of the string. The second line of each test case contains a non-empty binary string of length $$$n$$$. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^5$$$.

For every test case print four integers $$$l_1$$$, $$$r_1$$$, $$$l_2$$$, $$$r_2$$$, which denote the beginning of the first substring, the end of the first substring, the beginning of the second substring, and the end of the second substring, respectively. If there are multiple solutions, print any.

'use strict'
var os = require('os')
function createInput(n) {
  const t = n.stdin || process.stdin,
    e = /-?\d+/g,
    r = /-?\d+(?:\.\d+)?/g
  let u = [],
    i = 0
  return {
    init: async function () {
      const n = []
      ;(u = await new Promise(e => {
        t.on('data', t => n.push(t)),
          t.on('end', function () {
            const t = n.join('').split(os.EOL)
            e(t)
          })
      })),
        (i = 0)
    },
    dried: function () {
      return i >= u.length
    },
    readLine: o,
    readLineAsNumber: function () {
      return Number(o())
    },
    readIntegersOfLine: function () {
      const n = o().match(e)
      return null == n ? [] : n.map(n => Number(n))
    },
    readNumsOfLine: function () {
      const n = o().match(r)
      return null == n ? [] : n.map(n => Number(n))
    },
  }
  function o() {
    return u[i++]
  }
}
function createOutput(n) {
  const t = n.stdout || process.stdout,
    e = n.encoding || 'ascii',
    r = n.outputBufferThreshold || 1 << 24,
    u = Buffer.alloc(r)
  let i = 0
  return {
    flush: o,
    print: function (n) {
      c('string' == typeof n ? n : n.toString())
    },
    println: function (n) {
      c(('string' == typeof n ? n : n.toString()).concat('\n'))
    },
  }
  function o() {
    t.write(u.toString(e, 0, i)), (i = 0)
  }
  function c(n) {
    const c = Buffer.byteLength(n, e)
    r - i < c && (o(), c >= r) ? t.write(n) : (u.write(n, i, e), (i += c))
  }
}
function createInputAndOutput(n) {
  return {
    ...createInput({ stdin: n.stdin, encoding: n.encoding }),
    ...createOutput({
      stdout: n.stdout,
      encoding: n.encoding,
      outputBufferThreshold: n.outputBufferThreshold,
    }),
  }
}
async function __main__(n, t, e = {}) {
  const r = createInputAndOutput(e)
  await Promise.all([r.init(), Promise.resolve(t && t())]),
    await n(r),
    r.flush()
}
__main__(function (n) {
  const t = n.readLineAsNumber()
  for (let r = 1; r <= t; ++r) {
    const t = e(n.readLineAsNumber(), n.readLine().trim()).map(n => n + 1)
    n.println(t.join(' '))
  }
  function e(n, t) {
    const e = n >> 1
    for (let r = e; r < n; ++r) if ('0' === t[r]) return [0, r, 0, r - 1]
    for (let r = 0, u = n - e; r < u; ++r)
      if ('0' === t[r]) return [r, n - 1, r + 1, n - 1]
    return [1, e, 0, e - 1]
  }
})

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

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

var deb; const log = msg => (typeof deb != "undefined") && console.log("DEBUG", msg);

function main () {
	let T = rn();
	while (T--) {
		const n = rn();
		const s = rl();

		let zeroPos;
		for (let i = 0; i < n; i++) if (s[i] == '0') zeroPos = i + 1;

		if (zeroPos) {
			if (zeroPos <= n >> 1 ) {
				console.log(zeroPos, n, zeroPos + 1, n);
			} else {
				console.log(1, zeroPos, 1, zeroPos - 1);
			}
		} else {
			console.log(1, n - 1, 2, n);
		}
	}
}

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

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

var deb; const log = msg => (typeof deb != "undefined") && console.log("DEBUG", msg);

function main () {
	let T = rn();
	while (T--) {
		const n = rn();
		const s = rl();

		let zeroPos;
		let mid = (n >> 1) - 1;
		for (let i = mid + 1; i < n; i++) if (s[i] == '0') zeroPos = i;

		if (zeroPos) {
			++zeroPos;
			console.log(1, zeroPos, 1, zeroPos - 1);
		} else {
			if (s[mid] == '0') {
				++mid;
				console.log(mid, n, mid + 1, n);
			} else {
				++mid;
				console.log(mid, n - 1, mid + 1, n);
			}
		}
	}
}

'use strict'
var os = require('os')
function createInput(n) {
  const t = n.stdin || process.stdin,
    e = /-?\d+/g,
    r = /-?\d+(?:\.\d+)?/g
  let u = [],
    i = 0
  return {
    init: async function () {
      const n = []
      ;(u = await new Promise(e => {
        t.on('data', t => n.push(t)),
          t.on('end', function () {
            const t = n.join('').split(os.EOL)
            e(t)
          })
      })),
        (i = 0)
    },
    dried: function () {
      return i >= u.length
    },
    readLine: o,
    readLineAsNumber: function () {
      return Number(o())
    },
    readIntegersOfLine: function () {
      const n = o().match(e)
      return null == n ? [] : n.map(n => Number(n))
    },
    readNumsOfLine: function () {
      const n = o().match(r)
      return null == n ? [] : n.map(n => Number(n))
    },
  }
  function o() {
    return u[i++]
  }
}
function createOutput(n) {
  const t = n.stdout || process.stdout,
    e = n.encoding || 'ascii',
    r = n.outputBufferThreshold || 1 << 24,
    u = Buffer.alloc(r)
  let i = 0
  return {
    flush: o,
    print: function (n) {
      c('string' == typeof n ? n : n.toString())
    },
    println: function (n) {
      c(('string' == typeof n ? n : n.toString()).concat('\n'))
    },
  }
  function o() {
    t.write(u.toString(e, 0, i)), (i = 0)
  }
  function c(n) {
    const c = Buffer.byteLength(n, e)
    r - i < c && (o(), c >= r) ? t.write(n) : (u.write(n, i, e), (i += c))
  }
}
function createInputAndOutput(n) {
  return {
    ...createInput({ stdin: n.stdin, encoding: n.encoding }),
    ...createOutput({
      stdout: n.stdout,
      encoding: n.encoding,
      outputBufferThreshold: n.outputBufferThreshold,
    }),
  }
}
async function __main__(n, t, e = {}) {
  const r = createInputAndOutput(e)
  await Promise.all([r.init(), Promise.resolve(t && t())]),
    await n(r),
    r.flush()
}
__main__(function (n) {
  const t = n.readLineAsNumber()
  for (let r = 1; r <= t; ++r) {
    const t = e(n.readLineAsNumber(), n.readLine().trim()).map(n => n + 1)
    n.println(t.join(' '))
  }
  function e(n, t) {
    const e = n >> 1
    for (let r = e; r < n; ++r) if ('0' === t[r]) return [0, r, 0, r - 1]
    for (let r = 0, u = n - e; r < u; ++r)
      if ('0' === t[r]) return [r, n - 1, r + 1, n - 1]
    return 1 & e ? [0, e + 2, 0, e] : [0, e + 1, 0, e - 1]
  }
})

'use strict'
var os = require('os')
function createInput(n) {
  const t = n.stdin || process.stdin,
    e = /-?\d+/g,
    r = /-?\d+(?:\.\d+)?/g
  let u = [],
    i = 0
  return {
    init: async function () {
      const n = []
      ;(u = await new Promise(e => {
        t.on('data', t => n.push(t)),
          t.on('end', function () {
            const t = n.join('').split(os.EOL)
            e(t)
          })
      })),
        (i = 0)
    },
    dried: function () {
      return i >= u.length
    },
    readLine: o,
    readLineAsNumber: function () {
      return Number(o())
    },
    readIntegersOfLine: function () {
      const n = o().match(e)
      return null == n ? [] : n.map(n => Number(n))
    },
    readNumsOfLine: function () {
      const n = o().match(r)
      return null == n ? [] : n.map(n => Number(n))
    },
  }
  function o() {
    return u[i++]
  }
}
function createOutput(n) {
  const t = n.stdout || process.stdout,
    e = n.encoding || 'ascii',
    r = n.outputBufferThreshold || 1 << 24,
    u = Buffer.alloc(r)
  let i = 0
  return {
    flush: o,
    print: function (n) {
      c('string' == typeof n ? n : n.toString())
    },
    println: function (n) {
      c(('string' == typeof n ? n : n.toString()).concat('\n'))
    },
  }
  function o() {
    t.write(u.toString(e, 0, i)), (i = 0)
  }
  function c(n) {
    const c = Buffer.byteLength(n, e)
    r - i < c && (o(), c >= r) ? t.write(n) : (u.write(n, i, e), (i += c))
  }
}
function createInputAndOutput(n) {
  return {
    ...createInput({ stdin: n.stdin, encoding: n.encoding }),
    ...createOutput({
      stdout: n.stdout,
      encoding: n.encoding,
      outputBufferThreshold: n.outputBufferThreshold,
    }),
  }
}
async function __main__(n, t, e = {}) {
  const r = createInputAndOutput(e)
  await Promise.all([r.init(), Promise.resolve(t && t())]),
    await n(r),
    r.flush()
}
__main__(function (n) {
  const t = n.readLineAsNumber()
  for (let r = 1; r <= t; ++r) {
    const t = e(n.readLineAsNumber(), n.readLine().trim()).map(n => n + 1)
    n.println(t.join(' '))
  }
  function e(n, t) {
    const e = n >> 1
    for (let r = e; r < n; ++r) if ('0' === t[r]) return [0, r, 0, r - 1]
    for (let r = 0, u = n - e; r < u; ++r)
      if ('0' === t[r]) return [r, n - 1, r + 1, n - 1]
    return 1 & e ? [0, e + 1, 0, e - 1] : [0, e + 2, 0, e]
  }
})

'use strict'
var os = require('os')
function createInput(n) {
  const t = n.stdin || process.stdin,
    e = /-?\d+/g,
    r = /-?\d+(?:\.\d+)?/g
  let u = [],
    i = 0
  return {
    init: async function () {
      const n = []
      ;(u = await new Promise(e => {
        t.on('data', t => n.push(t)),
          t.on('end', function () {
            const t = n.join('').split(os.EOL)
            e(t)
          })
      })),
        (i = 0)
    },
    dried: function () {
      return i >= u.length
    },
    readLine: o,
    readLineAsNumber: function () {
      return Number(o())
    },
    readIntegersOfLine: function () {
      const n = o().match(e)
      return null == n ? [] : n.map(n => Number(n))
    },
    readNumsOfLine: function () {
      const n = o().match(r)
      return null == n ? [] : n.map(n => Number(n))
    },
  }
  function o() {
    return u[i++]
  }
}
function createOutput(n) {
  const t = n.stdout || process.stdout,
    e = n.encoding || 'ascii',
    r = n.outputBufferThreshold || 1 << 24,
    u = Buffer.alloc(r)
  let i = 0
  return {
    flush: o,
    print: function (n) {
      c('string' == typeof n ? n : n.toString())
    },
    println: function (n) {
      c(('string' == typeof n ? n : n.toString()).concat('\n'))
    },
  }
  function o() {
    t.write(u.toString(e, 0, i)), (i = 0)
  }
  function c(n) {
    const c = Buffer.byteLength(n, e)
    r - i < c && (o(), c >= r) ? t.write(n) : (u.write(n, i, e), (i += c))
  }
}
function createInputAndOutput(n) {
  return {
    ...createInput({ stdin: n.stdin, encoding: n.encoding }),
    ...createOutput({
      stdout: n.stdout,
      encoding: n.encoding,
      outputBufferThreshold: n.outputBufferThreshold,
    }),
  }
}
async function __main__(n, t, e = {}) {
  const r = createInputAndOutput(e)
  await Promise.all([r.init(), Promise.resolve(t && t())]),
    await n(r),
    r.flush()
}
__main__(function (n) {
  const t = n.readLineAsNumber()
  for (let r = 1; r <= t; ++r) {
    const t = e(n.readLineAsNumber(), n.readLine().trim()).map(n => n + 1)
    n.println(t.join(' '))
  }
  function e(n, t) {
    const e = n >> 1
    for (let r = e; r < n; ++r) if ('0' === t[r]) return [0, r, 0, r - 1]
    for (let r = 0, u = n - e; r < u; ++r)
      if ('0' === t[r]) return [r, n - 1, r + 1, n - 1]
    return [-1, -1, -1, -1]
  }
})

'use strict'
var os = require('os')
function createInput(n) {
  const t = n.stdin || process.stdin,
    e = /-?\d+/g,
    r = /-?\d+(?:\.\d+)?/g
  let u = [],
    i = 0
  return {
    init: async function () {
      const n = []
      ;(u = await new Promise(e => {
        t.on('data', t => n.push(t)),
          t.on('end', function () {
            const t = n.join('').split(os.EOL)
            e(t)
          })
      })),
        (i = 0)
    },
    dried: function () {
      return i >= u.length
    },
    readLine: o,
    readLineAsNumber: function () {
      return Number(o())
    },
    readIntegersOfLine: function () {
      const n = o().match(e)
      return null == n ? [] : n.map(n => Number(n))
    },
    readNumsOfLine: function () {
      const n = o().match(r)
      return null == n ? [] : n.map(n => Number(n))
    },
  }
  function o() {
    return u[i++]
  }
}
function createOutput(n) {
  const t = n.stdout || process.stdout,
    e = n.encoding || 'ascii',
    r = n.outputBufferThreshold || 1 << 24,
    u = Buffer.alloc(r)
  let i = 0
  return {
    flush: o,
    print: function (n) {
      c('string' == typeof n ? n : n.toString())
    },
    println: function (n) {
      c(('string' == typeof n ? n : n.toString()).concat('\n'))
    },
  }
  function o() {
    t.write(u.toString(e, 0, i)), (i = 0)
  }
  function c(n) {
    const c = Buffer.byteLength(n, e)
    r - i < c && (o(), c >= r) ? t.write(n) : (u.write(n, i, e), (i += c))
  }
}
function createInputAndOutput(n) {
  return {
    ...createInput({ stdin: n.stdin, encoding: n.encoding }),
    ...createOutput({
      stdout: n.stdout,
      encoding: n.encoding,
      outputBufferThreshold: n.outputBufferThreshold,
    }),
  }
}
async function __main__(n, t, e = {}) {
  const r = createInputAndOutput(e)
  await Promise.all([r.init(), Promise.resolve(t && t())]),
    await n(r),
    r.flush()
}
__main__(function (n) {
  const t = n.readLineAsNumber()
  for (let r = 1; r <= t; ++r) {
    const t = e(n.readLineAsNumber(), n.readLine().trim()).map(n => n + 1)
    n.println(t.join(' '))
  }
  function e(n, t) {
    const e = n >> 1
    for (let r = e; r < n; ++r) if ('0' === t[r]) return [0, r - 1, 0, r]
    for (let r = 0, u = n - e; r < u; ++r)
      if ('0' === t[r]) return [r, n - 1, r + 1, n - 1]
    return [-1, -1, -1, -1]
  }
})

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

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

var deb; const log = msg => (typeof deb != "undefined") && console.log("DEBUG", msg);

function main () {
	let T = rn();
	while (T--) {
		const n = rn();
		const s = rl();

		let zeroPos;
		let mid = (n >> 1) - 1;
		for (let i = mid + 1; i < n; i++) if (s[i] == '0') zeroPos = i;
		console.log(zeroPos);

		if (zeroPos) {
			++zeroPos;
			console.log(1, zeroPos, 1, zeroPos - 1);
		} else {
			if (s[mid] == '0') {
				++mid;
				console.log(mid, n, mid + 1, n);
			} else {
				++mid;
				console.log(mid, n - 1, mid + 1, n);
			}
		}
	}
}

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

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

var deb; const log = msg => (typeof deb != "undefined") && console.log("DEBUG", msg);

function main () {
	let T = rn();
	while (T--) {
		const n = rn();
		const s = rl();

		let zeroPos;
		let mid = (n >> 1) - 1;
		for (let i = mid + 1; i < n; i++) if (s[i] == '0') zeroPos = i;

		if (zeroPos) {
			++zeroPos;
			console.log(1, zeroPos - 1, 1, zeroPos);
		} else {
			if (s[mid] == '0') {
				++mid;
				console.log(mid, n, mid + 1, n);
			} else {
				++mid;
				console.log(mid, n - 1, mid + 1, n);
			}
		}
	}
}


There are $$$n$$$ quests. If you complete the $$$i$$$-th quest, you will gain $$$a_i$$$ coins. You can only complete at most one quest per day. However, once you complete a quest, you cannot do the same quest again for $$$k$$$ days. (For example, if $$$k=2$$$ and you do quest $$$1$$$ on day $$$1$$$, then you cannot do it on day $$$2$$$ or $$$3$$$, but you can do it again on day $$$4$$$.)You are given two integers $$$c$$$ and $$$d$$$. Find the maximum value of $$$k$$$ such that you can gain at least $$$c$$$ coins over $$$d$$$ days. If no such $$$k$$$ exists, output Impossible. If $$$k$$$ can be arbitrarily large, output Infinity.

The input consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. The description of the test cases follows. The first line of each test case contains three integers $$$n,c,d$$$ ($$$2 \leq n \leq 2\cdot10^5$$$; $$$1 \leq c \leq 10^{16}$$$; $$$1 \leq d \leq 2\cdot10^5$$$) — the number of quests, the number of coins you need, and the number of days. The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \leq a_i \leq 10^9$$$) — the rewards for the quests. The sum of $$$n$$$ over all test cases does not exceed $$$2\cdot10^5$$$, and the sum of $$$d$$$ over all test cases does not exceed $$$2\cdot10^5$$$.

For each test case, output one of the following.    If no such $$$k$$$ exists, output Impossible.  If $$$k$$$ can be arbitrarily large, output Infinity.  Otherwise, output a single integer — the maximum value of $$$k$$$ such that you can gain at least $$$c$$$ coins over $$$d$$$ days.  case-sensitive

NoteIn the first test case, one way to earn $$$5$$$ coins over $$$4$$$ days with $$$k=2$$$ is as follows:   Day 1: do quest 2, and earn $$$2$$$ coins.  Day 2: do quest 1, and earn $$$1$$$ coin.  Day 3: do nothing.  Day 4: do quest 2, and earn $$$2$$$ coins.  In total, we earned $$$2+1+2=5$$$ coins.In the second test case, we can make over $$$20$$$ coins on the first day itself by doing the first quest to earn $$$100$$$ coins, so the value of $$$k$$$ can be arbitrarily large, since we never need to do another quest.In the third test case, no matter what we do, we can't earn $$$100$$$ coins over $$$3$$$ days.

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

function solve(n, c, d, arr) {
    n = +n
    c = BigInt(c)
    d = +d
    //
    arr.sort((a, b) => b - a)
    const sum = Array(n)
    sum[0] = BigInt(arr[0])
    for (let i = 1; i < arr.length; i++) {
        sum[i] = sum[i - 1] + BigInt(arr[i])
    }
    //
    // console.log(sum, d)
    if (sum[Math.min(n - 1, d - 1)] >= c) return 'Infinity'

    const mk = binarySearch(0, d, k => {
        const r = d % (k + 1)
        const t = Math.floor(d / (k + 1))
        // [0, r - 1], [r, k]
        const a = sum[Math.min(n - 1, r - 1)] || 0n
        const b = r <= n - 1 ? range(r, Math.min(n - 1, k)) : 0n
        // if (k === 0) {
        //     console.log(a, b, arr)
        // }
        // console.log(r, t, '-', a, b)
        // console.log(k, a * BigInt(t + 1) + b * BigInt(t))
        return a * BigInt(t + 1) + b * BigInt(t) >= c
    })
    return mk === -1 ? 'Impossible' : mk

    function range(l, r) {
        return sum[r] - (sum[l - 1] || 0n)
    }
}
function binarySearch(l, r, fn) {
    while (l <= r) {
        const m = Math.floor((l + r) / 2)
        if (fn(m)) {
            l = m + 1
        } else {
            r = m - 1
        }
    }
    return r
}

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

function solve(n, c, d, arr) {
    n = +n
    c = BigInt(c)
    d = +d
    //
    arr.sort((a, b) => b - a)
    const sum = Array(n)
    sum[0] = BigInt(arr[0])
    for (let i = 1; i < arr.length; i++) {
        sum[i] = sum[i - 1] + BigInt(arr[i])
    }
    //
    // console.log(sum, d)
    if (sum[Math.min(n - 1, d - 1)] >= c) return 'Infinity'

    const mk = binarySearch(0, d, k => {
        const r = d % (k + 1)
        const t = Math.floor(d / (k + 1))
        // [0, r - 1], [r, k]
        const a = sum[r - 1] || 0n
        const b = range(r, Math.min(n - 1, k))
        // if (k === 0) {
        //     console.log(a, b, arr)
        // }
        return a * BigInt(t + 1) + b * BigInt(t) >= c
    })
    return mk === -1 ? 'Impossible' : mk

    function range(l, r) {
        return sum[r] - (sum[l - 1] || 0n)
    }
}
function binarySearch(l, r, fn) {
    while (l <= r) {
        const m = Math.floor((l + r) / 2)
        if (fn(m)) {
            l = m + 1
        } else {
            r = m - 1
        }
    }
    return r
}

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

function solve(n, c, d, arr) {
    n = +n
    c = BigInt(c)
    d = +d
    //
    arr.sort((a, b) => b - a)
    const sum = Array(n)
    sum[0] = BigInt(arr[0])
    for (let i = 1; i < arr.length; i++) {
        sum[i] = sum[i - 1] + BigInt(arr[i])
    }
    //
    // console.log(sum, d)
    if (sum[Math.min(n - 1, d - 1)] >= c) return 'Infinity'

    const mk = binarySearch(0, d, k => {
        const r = d % (k + 1)
        const t = Math.floor(d / (k + 1))
        // [0, r - 1], [r, k]
        const a = sum[r - 1] || 0n
        const b = sum[Math.min(n - 1, k)]
        // if (k === 0) {
        //     console.log(a, b, arr)
        // }
        return a * BigInt(t + 1) + b * BigInt(t) >= c
    })
    return mk === -1 ? 'Impossible' : mk
}
function binarySearch(l, r, fn) {
    while (l <= r) {
        const m = Math.floor((l + r) / 2)
        if (fn(m)) {
            l = m + 1
        } else {
            r = m - 1
        }
    }
    return r
}


Vitaly enrolled in the course Advanced Useless Algorithms. The course consists of $$$n$$$ tasks. Vitaly calculated that he has $$$a_i$$$ hours to do the task $$$i$$$ from the day he enrolled in the course. That is, the deadline before the $$$i$$$-th task is $$$a_i$$$ hours. The array $$$a$$$ is sorted in ascending order, in other words, the job numbers correspond to the order in which the assignments are turned in.Vitaly does everything conscientiously, so he wants to complete each task by $$$100$$$ percent, or more. Initially, his completion rate for each task is $$$0$$$ percent.Vitaly has $$$m$$$ training options, each option can be used not more than once. The $$$i$$$th option is characterized by three integers: $$$e_i, t_i$$$ and $$$p_i$$$. If Vitaly uses the $$$i$$$th option, then after $$$t_i$$$ hours (from the current moment) he will increase the progress of the task $$$e_i$$$ by $$$p_i$$$ percent. For example, let Vitaly have $$$3$$$ of tasks to complete. Let the array $$$a$$$ have the form: $$$a = [5, 7, 8]$$$. Suppose Vitaly has $$$5$$$ of options: $$$[e_1=1, t_1=1, p_1=30]$$$, $$$[e_2=2, t_2=3, p_2=50]$$$, $$$[e_3=2, t_3=3, p_3=100]$$$, $$$[e_4=1, t_4=1, p_4=80]$$$, $$$[e_5=3, t_5=3, p_5=100]$$$. Then, if Vitaly prepares in the following way, he will be able to complete everything in time:   Vitaly chooses the $$$4$$$-th option. Then in $$$1$$$ hour, he will complete the $$$1$$$-st task at $$$80$$$ percent. He still has $$$4$$$ hours left before the deadline for the $$$1$$$-st task.  Vitaly chooses the $$$3$$$-rd option. Then in $$$3$$$ hours, he will complete the $$$2$$$-nd task in its entirety. He has another $$$1$$$ hour left before the deadline for the $$$1$$$-st task and $$$4$$$ hours left before the deadline for the $$$3$$$-rd task.  Vitaly chooses the $$$1$$$-st option. Then after $$$1$$$ hour, he will complete the $$$1$$$-st task for $$$110$$$ percent, which means that he will complete the $$$1$$$-st task just in time for the deadline.  Vitaly chooses the $$$5$$$-th option. He will complete the $$$3$$$-rd task for $$$2$$$ hours, and after another $$$1$$$ hour, Vitaly will complete the $$$3$$$-rd task in its entirety. Thus, Vitaly has managed to complete the course completely and on time, using the $$$4$$$ options.Help Vitaly — print the options for Vitaly to complete the tasks in the correct order. Please note: each option can be used not more than once. If there are several possible answers, it is allowed to output any of them.

The first line of input data contains an integer $$$T$$$ ($$$1 \le T \le 10^4$$$) —the number of input test cases in the test. The descriptions of the input test case follow. The first line of each test case description contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n,m \le 10^5$$$) —the number of jobs and the number of training options, respectively. The next line contains $$$n$$$ numbers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the time before the deadline of job $$$i$$$. The array values — are non-decreasing, that is $$$a_1 \le a_2 \le \dots \le a_n$$$. The following $$$m$$$ lines contain triples of numbers $$$e_i, t_i, p_i$$$ ($$$1 \le e_i \le n$$$, $$$1 \le t_i \le 10^9$$$, $$$1 \le p_i \le 100$$$) — if Vitaly chooses this option, then after $$$t_i$$$ hours he will increase the progress of the task $$$e_i$$$ by $$$p_i$$$ percent. The options are numbered from $$$1$$$ to $$$m$$$ in order in the input data. It is guaranteed that the sum of $$$n+m$$$ on all test cases does not exceed $$$2 \cdot 10^5$$$.

For each test case, print on the first line the number $$$k$$$, meaning that for $$$k$$$ of options, Vitaly will be able to complete each task by $$$100$$$ percent or more on time. The options should not be repeated. Or print -1 if Vitaly is unable to complete all tasks in time. If there is an answer, on the next line print $$$k$$$ of different integers from $$$1$$$ to $$$m$$$ — the numbers of the options in the order you want. If there is more than one answer, it is allowed to print any of them.

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

function solve(n, m, arr, opts) {
    const sorted = arr.map((x, i) => ({ x, i }))
        .sort((a, b) => a.x - b.x)
    // group by e_i
    const gs = Array(n)
    opts.forEach(([e, t, p], i) => {
        e--
        gs[e] = gs[e] || []
        gs[e].push([t, p, i + 1])
    })
    // solve for each task
    let ans = []
    let total = 0
    for (let j = 0; j < n; j++) {
        const i = sorted[j].i
        if (!gs[i]) return -1
        const best = helper(arr[i], gs[i])
// console.log(best)
        if (!best) return -1

        const [nt, selected] = best
        total += nt
        if (total > arr[i]) return -1
        ans = ans.concat(selected)
    }
    return ans.length + '\n' + ans.join(' ')
}
function helper(d, opts) {
    // opts.sort((a, b) => {
    //     // a1/a0 > b1/b0
    //     return a[0] * b[1] - a[1] * b[0]
    // })
    // let i = 0
    // let np = 0
    // let nt = 0
    // const ans = []
    // while (np < 100 && i < opts.length) {
    //     const [t, p, idx] = opts[i++]
    //     if (nt + t > d) return null

    //     ans.push(idx)
    //     nt += t
    //     np += p
    // }
    // if (np < 100) return null
    // return [nt, ans]
    const dp = Array(opts.length)
    for (let i = 0; i < opts.length; i++) {
        const [t, p, idx] = opts[i]
        dp[i] = []
        for (let now = 0; now <= 100; now++) {
            // dp[i][now] = Math.min(
            //     dp[i - 1][now],
            //     dp[i - 1][now - p] + t,
            // )
            let prev, use, nt
            if (i) {
                if (now <= p) {
                    nt = t
                } else {
                    prev = now - p
                    nt = dp[i - 1][now - p] + t
                }
                if (nt < dp[i - 1][now]) {
                    use = 1
                } else {
                    prev = now
                    nt = dp[i - 1][now]
                }
            } else {
                if (now <= p) {
                    use = 1
                    nt = t
                } else {
                    nt = Infinity
                }
            }
            dp[i][now] = nt // [prev, use, nt]
        }
        // for (let h = 0; h <= d; h++) {
        //     const now = Math.max(
        //         dp[i - 1][h],
        //         dp[i - 1][h - t] + p,
        //     )
        // }
    }
    const final = dp[opts.length - 1][100]
// console.log(final)
    if (final > d) return null

    const ans = []
    let p = 100
    for (let i = opts.length - 1; i >= 0; i--) {
// console.log(i, p)
        // const [prev, use, nt] = dp[i][p]
        // if (use) ans.push(opts[i][2])
        // if (!prev) break
        if (i && dp[i][p] === dp[i - 1][p]) continue
        // [t, p, idx]
        p -= opts[i][1]
        ans.push(opts[i][2])
        // p = prev
        if (p <= 0) break
    }
    return [final, ans]
}

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

function solve(n, m, arr, opts) {
    // group by e_i
    const gs = Array(n)
    opts.forEach(([e, t, p], i) => {
        e--
        gs[e] = gs[e] || []
        gs[e].push([t, p, i + 1])
    })
    // solve for each task
    let ans = []
    for (let i = 0; i < n; i++) {
        const best = helper(arr[i], gs[i] || [])
// console.log(best)
        if (!best) return -1
        ans = ans.concat(best)
    }

    return ans.length + '\n' + ans.join(' ')
}
function helper(d, opts) {
    opts.sort((a, b) => {
        // a1/a0 > b1/b0
        return a[0] * b[1] - a[1] * b[0]
    })
    let i = 0
    let np = 0
    let nt = 0
    const ans = []
    while (np < 100 && i < opts.length) {
        const [t, p, idx] = opts[i++]
        if (nt + t > d) return null

        ans.push(idx)
        nt += t
        np += p
    }
    if (np < 100) return null
    return ans
    // const dp = Array(opts.length)
    // for (let i = 0; i < opts.length; i++) {
    //     const [idx, t, p] = opts[i]
    //     dp[i] = []
    //     for (let h = 0; h <= d; h++) {
    //         const now = Math.max(
    //             dp[i - 1][h],
    //             dp[i - 1][h - t] + p,
    //         )
    //     }
    // }
}


There are $$$n$$$ points on the plane, $$$(x_1,y_1), (x_2,y_2), \ldots, (x_n,y_n)$$$.You need to place an isosceles triangle with two sides on the coordinate axis to cover all points (a point is covered if it lies inside the triangle or on the side of the triangle). Calculate the minimum length of the shorter side of the triangle.

First line contains one integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$). Each of the next $$$n$$$ lines contains two integers $$$x_i$$$ and $$$y_i$$$ ($$$1 \leq x_i,y_i \leq 10^9$$$).

Print the minimum length of the shorter side of the triangle. It can be proved that it's always an integer.

NoteIllustration for the first example: Illustration for the second example:

var n = +readline(), max = -1;
while (n-->0){
    var ip = readline().split(' ').map(Number);
    max = Math.max(max,ip[0]+ip[1]);
}
print(max);

function main(){
    var n = parseInt(readline());
    var maxX = -1;
    var maxY = -1;
    var maxLength = 0;
    for(var i =  0; i < n; ++i){
        var point = readline().split(" ").map(function(x) { return parseInt(x); });
        var x = point[0];
        var y = point[1];
        if(x + y> maxLength){
            maxLength = x + y;
        }
    }
    print(maxLength)
}

main()

'use strict';
var n = parseInt(readline());
var max = -1;
for (var i = 0; i < n; i++) {
    var input = readline().split(' ').map(n => parseInt(n));
    max = Math.max(max, input[0] + input[1])
}
print(max);

var n = parseInt(readline());
var xYSum = 0;

for(var i = 0; i < n; i++)
{
    var a = readline().split(" ");
    var newXYSum = parseInt(a[0]) + parseInt(a[1]);

    if(newXYSum > xYSum)
        xYSum = newXYSum;
}

print(xYSum);

function Nur_Alam(){

    var n = readline();
    var c = -1;

    while(n--){
        var a= readline().split(' ').map(Number);
        c = Math.max(c, a[0]+a[1]);
     }
     print(c);
}

Nur_Alam()

function hlw_callme(){

    var n = readline();
    var c = -1;

    while(n--){
        var a= readline().split(' ').map(Number);
        c = Math.max(c, a[0]+a[1]);
     }
     print(c);
}

hlw_callme();

function main() {
  const cin = new Scanner();
  let a, b;
  let answer = 0;
  for (let t = cin.nextInt(); t !== 0; t -= 1) {
    [a, b] = cin.nextArray();
    answer = Math.max(answer, a + b);
  }
  console.log(answer);
}

/*
 *  Api Scanner
 */
class Scanner {
  constructor() {
    this.index = -1;
    this.lines = stdinInput.trim().split('\n'); // eslint-disable-line
  }

  nextLine() {
    this.index += 1;
    return this.lines[this.index].trim();
  }

  nextInt() {
    return parseInt(this.nextLine(), 10);
  }

  nextDouble() {
    return parseFloat(this.nextLine());
  }

  nextArray(fn = Number) {
    const array = this.nextLine().split(' ');
    if (fn !== String)
      array.forEach((item, index, arr) => { arr[index] = fn(item); });
    return array;
  }

  hasNext() {
    return this.index < this.lines.length;
  }
}

let stdinInput = '';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', (input) => { stdinInput += input; });
process.stdin.on('end', () => { main(); });

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

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

  const [a, b] = d.split(' ').map(Number);
  ans = Math.max(ans, a + b);

  c++;
});

rl.on('close', () => {
  console.log(ans);
});

function main(){
    var n = parseInt(readline());
    var maxX = -1;
    var maxY = -1;
    var maxLength = 0;
    for(var i =  0; i < n; ++i){
        var point = readline().split(" ").map(function(x) { return parseInt(x); });
        var x = point[0];
        var y = point[1];
        if(x * x + y * y > maxLength){
            maxLength = x * x  + y * y;
            maxX = x;
            maxY = y;
        }
    }
    print(x + y)
}

main()

var ans = -1
var n = readline()

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

    var c = Math.max(c, a+b)
}
print(c)

var n = readline()
var c = -1

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

    c = Math.max(c, a+b)
}
print(c)

function main() {
  const cin = new Scanner();
  let a, b;
  let answer = 0;
  for (let t = cin.nextInt(); t !== 0; t -= 1) {
    [a, b] = cin.nextArray(Number);
    answer = Math.max(answer, a + b);
  }

}

/*
 *  Api Scanner
 */
class Scanner {
  constructor() {
    this.index = -1;
    this.lines = stdinInput.trim().split('\n'); // eslint-disable-line
  }

  nextLine() {
    this.index += 1;
    return this.lines[this.index].trim();
  }

  nextInt() {
    return parseInt(this.nextLine(), 10);
  }

  nextDouble() {
    return parseFloat(this.nextLine());
  }

  nextArray(fn = String) {
    const array = this.nextLine().split(' ');
    if (fn !== String)
      array.forEach((item, index, arr) => { arr[index] = fn(item); });
    return array;
  }

  hasNext() {
    return this.index < this.lines.length;
  }
}

let stdinInput = '';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', (input) => { stdinInput += input; });
process.stdin.on('end', () => { main(); });


You are given $$$n$$$ numbers $$$a_1, a_2, \ldots, a_n$$$. Is it possible to arrange them in a circle in such a way that every number is strictly less than the sum of its neighbors?For example, for the array $$$[1, 4, 5, 6, 7, 8]$$$, the arrangement on the left is valid, while arrangement on the right is not, as $$$5\ge 4 + 1$$$ and $$$8> 1 + 6$$$.

The first line contains a single integer $$$n$$$ ($$$3\le n \le 10^5$$$) — the number of numbers. The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \leq a_i \le 10^9$$$) — the numbers. The given numbers are not necessarily distinct (i.e. duplicates are allowed).

If there is no solution, output "NO" in the first line.  If there is a solution, output "YES" in the first line. In the second line output $$$n$$$ numbers — elements of the array in the order they will stay in the circle. The first and the last element you output are considered neighbors in the circle. If there are multiple solutions, output any of them. You can print the circle starting with any element.

NoteOne of the possible arrangements is shown in the first example: $$$4< 2 + 3$$$;$$$2 < 4 + 3$$$;$$$3< 4 + 2$$$.One of the possible arrangements is shown in the second example.No matter how we arrange $$$13, 8, 5$$$ in a circle in the third example, $$$13$$$ will have $$$8$$$ and $$$5$$$ as neighbors, but $$$13\ge 8 + 5$$$. There is no solution in the fourth example.

readline();
var arr = readline().split(' ').map(item => +item).sort((var1, var2) => var2 - var1);
if (arr[0] < arr[1] + arr[2]) {
  print('YES');
  print([arr[2], arr[0], arr[1]].concat(arr.slice(3)).join(' '))
} else {
  print('NO');
}

"use strict";

// readline().split(' ').map(value => +value);
var n = +readline();
var A = readline().split(' ').map(value => +value);
A.sort((a, b) => b - a);

if (A[0] >= A[1] + A[2]) {
    write('NO');
} else {
    var result = A.filter((v, i) => !(i%2)).concat(A.filter((v, i) => !!(i%2)).reverse());
    write('YES\n');
    write(result.join(' '));
}

var n = parseInt(readline());
var arr = readline().split(" ").map((i) =>parseInt(i) );

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

if (arr[n - 1] >= arr[n - 2] + arr[n - 3]) {
    print("NO");
} else {
    print("YES");

    var output = `${arr[n-2]} ${arr[n-1]} ${arr[n-3]} `;

    arr = arr.splice(0, n-3);

    output += arr.join(" ");

    print(output);
}

process.stdin.setEncoding("ascii");

let input = "";

process.stdin.on("data", data => {
    input += data;
});

process.stdin.on("end", () => {
    const numbers = input.split("\n")[1].split(" ").map(Number);
    numbers.sort((a, b) => a - b);
    const n = numbers.length;
    const [third, second, first, ...theRest] = numbers.reverse();
    if (third >= first + second) {
        console.log("NO");
        return;
    }
    console.log("YES");
    console.log([first, third, second, ...theRest].join(" "));
});

var n = parseInt(readline());
var arr = readline().split(" ").map(function(i) { return parseInt(i); });

arr.sort();

if (arr[n - 1] >= arr[n - 2] + arr[n - 3]) {
    print("NO");
} else {
    print("YES");
    print(arr.join(" "))
}

var n = parseInt(readline());
var arr = readline().split(" ").map((i) =>parseInt(i) );

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

if (arr[n - 1] >= arr[n - 2] + arr[n - 3]) {
    print("NO");
} else {
    print("YES");
    print(arr.join(" "))
}

process.stdin.setEncoding("ascii");

let input = "";

process.stdin.on("data", data => {
    input += data;
});

process.stdin.on("end", () => {
    console.log("YES");
    console.log("4 2 3");
});