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 i=1;i<=t;i++)
    {
        let [a,b,c]=line[i].split(' ').map(x=>{return parseInt(x)});
        if(a===b+c||b===a+c||c===a+b)
        {
            console.log("YES");
        }
        else
        {
            console.log("NO");
        }
    }
})

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

let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});
process.stdin.on("end", (_) => {
  inputString = inputString.trim().split("\n").map((string) => {
      return string.trim();
    });
  main();
});
function readline() {
  return inputString[currentLine++];
}
function main() {
  let n = readline();
  for (let i = 0; i < n; i++) {
    let [a, b, c] = readline().split(" ").map(Number);
    if (((a + b + c) / 2) == a || ((a + b + c) / 2) == b || ((a + b + c) / 2) == c) {
      console.log("YES");
    } else {
      console.log("NO");
    }
  }
}

'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function main(){
    const testNumbers = readline()

    for(let i = 0; i<testNumbers; i++){
        solve(readline().split(" ").map(x=>parseInt(x)));
    }
}

function solve(input){
    console.log(
        Math.abs(input[0]-input[1]) == input[2]
        ||
        Math.abs(input[0]-input[2]) == input[1]
        ||
        Math.abs(input[1]-input[2]) == input[0]
        ? 'YES':'NO'
    )
}

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

let standardInputString = ''
let currentLine = 0

function readLine() {
    return standardInputString[currentLine++]
}
process.stdin.on('data', rawData => {
    standardInputString += rawData
})

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

    main()
})

//   .........................................................   //\

const main = () => {
    const testCase = parseInt(readLine());

    for (let index = 0; index < testCase; index++) {
        const a = readLine().split(" ").map(x => parseInt(x));

        console.log(sum(a[0], a[1], a[2]));

    }
}

const sum = (a, b, c) => {
    if (a + b === c || a + c === b || b + c === a)
        return 'YES';
    return 'NO';

}

const lines = [];
const readlineInterface = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
readlineInterface.on("line", (line) => {
  lines.push(line);
});
readlineInterface.on("close", () => {
  const tests = lines.slice(1).map((line) => line.split(" ").map((e) => +e));

  tests
    .map((numbers) => {
      const sum = numbers.reduce((a, b) => a + b, 0);
      return numbers.find((e) => e === sum / 2) !== undefined ? "YES" : "NO";
    })
    .forEach((e) => console.log(e));
});

const fs = require('fs');
const input = fs.readFileSync(0, 'utf8').trim().split('\n');

let currentline = 0;
function readline(){
    return input[currentline++];
}

let T = readline();
for(let i = 1; i <= T; i++){
    let [a, b, c] = readline().split(' ').map(Number);
    console.log(solve(a, b, c));
}

function solve(a, b, c){
    return (a + b === c || b + c === a || a + c === b) ? 'YES' : 'NO';
}

// cls; cat .\input.txt | node .\script.js
// codium --diff file1.js file2.js
'use strict';
async function main(read) {
    let amount = Number(await read());
    let output = ""
    while (amount > 0) {
        try {
            let str = await read().split(' ')
            let a = Number(str[0]);
            let b = Number(str[1]);
            let c = Number(str[2]);
            let max = Math.max(a, b, c)
            output+=(max == (a + b + c - max) ? "YES" : "NO") + '\n'
        } catch (error) {
            console.log(error);
        }
        amount--

    }
    return output

}

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

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

let c = 0;

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

  const arr = d
    .split(" ")
    .map(Number)
    .sort((a, b) => a - b);

  if (arr[0] + arr[1] === arr[2]) {
    console.log("YES");
  } else {
    console.log("NO");
  }
  c++;
});

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

let stop = '';
process.stdin.on('data', c => stop += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = stop.split(EOL);
    var t = lines[0];
    for(i = 1; i <= t; i++){
       var k = lines[i].split(' ').map(Number).sort(function(a, b){return a - b});
       console.log(k[0] + k[1] == k[2] ? 'YES' : 'NO');
    }
});

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

//   return gcd(b, a % b);
// }
let ryan = '';//.map(Number).sort(function(a, b){return a - b})
process.stdin.on('data', c => ryan += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = ryan.split(EOL);
    var n = lines[0]
    for(j = 1; j <= n; j++){
       var k = lines[j].split(' ').map(Number).sort(function(a, b){return a - b})
       console.log(k[0] + k[1] == k[2] ? 'YES' : 'NO')
    }
});

const readline = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});
const sum = (a, b, c) => {
  if (a + b === c) return "YES";
  if (a + c === b) return "YES";
  if (b + c === a) return "YES";
  return "NO";
};
const inputs = [];

const solution = async () => {
  for await (const line of readline) {
    var num = line.split(" ").map((x) => parseInt(x));
    inputs.push(num);
  }

  for (let x = 1; x < inputs.length; x++) {
    console.log(sum(inputs[x][0], inputs[x][1], inputs[x][2]));
  }
};

solution();

'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    const x = parseInt(readline());
    for(let i = 0; i < x; i += 1) {
        const nums = readline().split(' ').map(n => parseInt(n));
        const isYes = nums.some((num, index) => {
            if (index === 0)
                return num === nums[1] + nums[2];
            else if (index === 1)
                return num === nums[0] + nums[2];
            else
                return num === nums[1] + nums[0];
        });

        if (isYes)
            console.log('YES');
        else
            console.log('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 checkSum(cases) {
  for (let i = 0; i < cases.length; i++) {
    const [first, second, third] = cases[i];
    if (
      Number(first) === Number(second) + Number(third) ||
      Number(second) === Number(first) + Number(third) ||
      Number(third) === Number(first) + Number(second)
    ) {
      console.log("YES");
    } else {
      console.log("NO");
    }
  }
}

function main() {
  const t = parseInt(readLine().trim());
  const cases = [];
  for (let i = 0; i < t; i++) {
    const numbers = readLine().split(" ");
    cases.push(numbers);
  }

  checkSum(cases);
}

"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
  console.log(x);
}
let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});
process.stdin.on("end", () => {
  inputString = inputString.split("\n");
  main();
});
function readline() {
  return inputString[currentLine++];
}

// ********** Code Start **********

function main() {
let n = parseInt(readline());
var num = undefined
while(n--){
     num =readline().split(' ').map(x => parseInt(x))
        if((num[0]+num[1] === num[2]) || (num[0]+num[2] === num[1]) || (num[2]+num[1] === num[0])){
            console.log(`YES`);

        }
        else{
            console.log(`NO`);
        }

}
}

/**
 * 10/13/22 morning
 * https://codeforces.com/contest/1742/problem/A
 */

const pr = console.log;

const solve = (a) => {
    if (a[0] + a[1] == a[2] || a[0] + a[2] == a[1] || a[1] + a[2] == a[0]) {
        pr("YES");
    } else {
        pr("NO");
    }
};

const main = () => {
    const readLine = () => input[currentLine++];
    const ni = () => readLine() - '0';
    const nas = () => readLine().split(" ");
    const nai = () => nas().map(Number);
    const nal = () => nas().map(BigInt);
    let input = '', currentLine = 0;
    process.stdin.on('data', (stdin) => input += stdin)
    process.stdin.on('end', () => {
        input = input.split('\n');
        let t = ni();
        while (t--) {
            let a = nai();
            solve(a);
        }
    });
};

main()

/*
** Template
*/

// Common Template Starts //
//*
process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

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

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

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Common Template Ends //

// Driver Function Starts //
const main = () => {
    console.clear()
    let t = parseInt(readline())
    while (t--) {
        // let n = parseInt(readline())
        let arr = readline().split(' ').map(Number)
        console.log(solve(arr))
    }
}
// Driver Function Ends //

// MAIN LOGIC
const solve = (arr) => {
    let a = arr[0]
    let b = arr[1]
    let c = arr[2]

    if( a === b + c ) return 'YES'
    if( b === c + a ) return 'YES'
    if( c === a + b ) return 'YES'

    return 'NO'
}

const isOdd = (num) => num & 1
const isEven = (num) => !(num & 1)
const minOfArray = (arr) => Math.min.apply(null, arr)
const maxOfArray = (arr) => Math.max.apply(null, arr)
const uniqueArray = (arr) => [...new Set(arr)]
const sortArray = (arr) => arr.sort((a, b) => a - b)
const sumOfArray = (arr) => arr.reduce((partialSum, a) => partialSum + a, 0)

// cmd: cat input.txt | node main.js

const readline = require("readline");

var tcn = 0

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

rl.on('line', line => {
  if (!tcn) return tcn = Number(line)

  run(line)

  if (!--tcn) rl.close()
})

function run(line) {
  var vals = line.split(' ').map(val => Number(val)).sort((a, b) => a - b)
  if (vals[2] == vals[1] + vals[0] || vals[0] == vals[1] + vals[2]) {
    console.log('YES')
  }
  else {
    console.log('NO')
  }
}

'use strict';

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

let processIn = '';
let processCurr = 0;

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

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

    JS();
});

function readLine() {
    return processIn[processCurr++];
}
function mergeSort(a) {
    let r = a.length;
    let l = 0;
    let m = Math.round((r - l) / 2);
    if (r === 1) {
        return;   // returns recursively
    }
    let L = [];   // left half of current a
    let R = [];   // right half of current a
    for (let i = l; i < m; i++) {
        L.push(a[i]);
    }
    for (let j = m; j < r; j++) {
        R.push(a[j]);
    }
    mergeSort(L);
    mergeSort(R);
    let i = 0, j = 0, k = 0;
    // Merging part
    while (i < L.length && j < R.length) {
        if (L[i] < R[j]) {
            a[k] = L[i];
            i++;
        } else {
            a[k] = R[j];
            j++;
        }
        k++;
    }
    while (i < L.length) {
        a[k] = L[i];
        i++;
        k++;
    }
    while (j < R.length) {
        a[k] = R[j];
        j++;
        k++;
    }
}

function JS() {
    /*

    */
    let tt = parseInt(readLine());
    // let tt = 1;
    for(let t=0;t<tt;++t){
        let inp = readLine().trim().split(' ').map(string => { return parseInt(string.trim()); });
        let a = inp[0],b=inp[1],c=inp[2];
        if(a === b+c || b === a+c || c === a+b){
            console.log('YES');
        }else{
            console.log('NO');
        }
    }
}

"use strict";

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

let inputString = "";
let currentLine = 0;

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

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

  main();
});

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

function main() {
  let n = readline();
  for (let i = 0; i < n; i++) {
    let [a, b, c] = readline().split(" ").map(Number);
    if (a + b === c || a + c === b || c + b === a) {
      console.log("YES");
    } else {
      console.log("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 arr = lines[l++].trim().split(' ').map(Number)
        output[i] = solve(arr)
    }
    console.log(output.join('\n'))
// })()
})

function solve(arr) {
    const [a, b, c] = arr.sort((a, b) => a - b)
    return a + b === c ? 'YES' : 'NO'
}

'use strict';

var fs = require('fs');

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

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

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  const a = rns(3),
        sum = a.reduce((a, b) => a + b, 0);
  for (let i = 0; i < 3; i++) {
    if (a[i] === sum - a[i]) return 'YES';
  }
  return 'NO';
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rn();
    return res;
  };
  const re = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rn() - 1;
    return res;
  };
  const rbs = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rb();
    return res;
  };
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  const [rn, rb, rns, re, rbs] = convertInput(r);
  try {
    let t = rn();
    let res = new Array(t);
    let limit = 0;
    for (let i = 0; i < t; i++) {
      var _solve;
      const s = (_solve = solve(r)) !== null && _solve !== void 0 ? _solve : '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      } else {
        res[i] = s;
      }
    }
    if (t >= limit) {
      return res.join('\n');
    } else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8')
.split(/\s+/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();

// run on javascript V8 4.8.0
// https://codeforces.com/contest/1742/problem/A
// You are given three integers a, b, and c. Determine if one of them is the sum of the other two.
function main() {
    var tn = +readline(); // Number of test cases
    for (var i = 0; i < tn; i++) {

        var a = readline().split(' ').map(Number);
        // Call solve()
        solve(a);
    }
}

function solve(a) {
    var a = a.sort(function(a, b){return a-b});
    if (a[0] + a[1] == a[2]) {
        print('YES');
    } else {
        print('NO');
    }
}

main();

function begin(a,b,c) {
    if(a == b + c) {
        print("YES");
    } else if(b == a + c) {
        print("YES");
    } else if(c == a + b) {
        print("YES");
    } else {
        print("NO");
    }
}

var caseNum = parseInt(readline(), 10);
for (var i = 0; i < caseNum; i++) {
    var x = readline()
        .trim()
        .split(' ')
        .map((y) => parseInt(y, 10));
        begin(x[0], x[1], x[2]);
}

var tests = +readline();

for(var i=0; i<tests; i++) {
    var input = readline().split(" ");
    var num1 = parseInt(input[0]);
    var num2 = parseInt(input[1]);
    var num3 = parseInt(input[2]);
    if((num1 + num2 == num3) || (num1 + num3 == num2) || (num3 + num2 == num1)) {
        print("YES");
    }else {
        print("NO");
    }
}

var a = readline();
var arr = [];
var max = 0;
var s = 0;
var f = 0;
for(var i = 0; i < a; i++){
    arr[i] = readline().split(' ').map(i=>Number(i));
    max = Math.max.apply(null,arr[i]);
    for(var j = 0; j < arr[i].length; j++){
        s+=arr[i][j];
        f=s-max;
    }if(f==max){
        print("YES");
    }else{
        print("NO");
    }
    f=0;
    max=0;
    s=0;
}

var limit = parseInt(readline());
for (var i = 0; i < limit; i++)
{
    var caseArray = readline().split(" ");
    var caseIntArray = new Array();
    for (var j = 0; j < caseArray.length; j++)
    {
        caseIntArray.push(parseInt(caseArray[j]));
    }
    var caseIntSorted = caseIntArray.sort((a,b) => a - b);
    if (caseIntSorted[2] == (caseIntSorted[1] + caseIntSorted[0]))
    {
        print("YES");
    }
    else print("NO");
}

t = readline()
while (t--) {
    input = readline().split(" ").map(Number).sort(function (a, b) { return a - b }).reverse()
    if (input[0] === input[1] + input[2]) {
        print("YES")
    } else {
        print("NO")
    }
}

const tc = readline();
for (var t =0 ; t<tc;t++){
    var input = readline().split(" ");
    var a = parseInt(input[0]), b=parseInt(input[1]), c=parseInt(input[2]);
    if(a+b==c || a+c==b ||b+c==a){
       print("YES");
    }else{
        print("NO");
    }
}

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

let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
  inputString += inputStdin;
});
process.stdin.on("end", (_) => {
  inputString = inputString.trim().split("\n").map((string) => {
      return string.trim();
    });
  main();
});
function readline() {
  return inputString[currentLine++];
}
function main() {
  let n = readline();
  for (let i = 0; i < n; i++) {
    let [a, b, c] = readline().split(" ").map(Number);
    if (((a + b + c) / 2) == a || b || c) {
      console.log("YES");
    } else {
      console.log("NO");
    }
  }
}

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

let inputString = "";
let currentLine = 0;

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

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

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

function main() {
  let n = readline();
  for (let i = 0; i < n; i++) {
    let [a, b, c] = readline().split(" ");
    if (a + b === c || a + c === b || c + b === a) {
      console.log("YES");
    } else {
      console.log("NO");
    }
  }
}

process.stdin.setEncoding('utf-8');
// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   process.stdout.write(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       process.stdout.write(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f, c = 0;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     process.stdout.write('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       process.stdout.write('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       process.stdout.write('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = parseInt(data.toString().trim());
    return;
  }
  var b;
  var Nums = data.trim().split(' ');
  for (var i = 0; i < Nums.length; i++) {
    if (((parseInt(Nums[0]) + parseInt(Nums[1]) + parseInt(Nums[2])) / 2) == parseInt(Nums[i])) {
      b = true;
      break;
    } else {
      b = false;
    }
  }
  if (b) {
    process.stdout.write('YES\n');
  } else {
    process.stdout.write('NO\n');
  }
  c++
  if (c == f) {
    process.exit();
  }
})

// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   process.stdout.write(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       process.stdout.write(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f, c = 0;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     process.stdout.write('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       process.stdout.write('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       process.stdout.write('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = parseInt(data.toString().trim());
    return;
  }
  var b;
  var Nums = data.toString().trim().split(' ');
  for (var i = 0; i < Nums.length; i++) {
    if (((parseInt(Nums[0]) + parseInt(Nums[1]) + parseInt(Nums[2])) / 2) == parseInt(Nums[i])) {
      b = true;
      break;
    } else {
      b = false;
    }
  }
  if (b) {
    process.stdout.write('YES\n');
  } else {
    process.stdout.write('NO\n');
  }
  c++
  if (c == f) {
    process.exit();
  }
})

// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   process.stdout.write(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       process.stdout.write(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f, c = 0;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     process.stdout.write('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       process.stdout.write('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       process.stdout.write('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       process.stdout.write('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       process.stdout.write('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = parseInt(data.toString().trim());
    return;
  }
  var b;
  var Nums = data.toString().trim().split(' ');
  for (var i = 0; i < Nums.length; i++) {
    if (((parseInt(Nums[0]) + parseInt(Nums[1]) + parseInt(Nums[2])) / 2) == parseInt(Nums[i])) {
      b = true;
      break;
    } else {
      b = false;
    }
  }
  if (b) {
    process.stdout.write('YES');
  } else {
    process.stdout.write('NO');
  }
  c++
  if (c == f) {
    process.exit();
  }
})

// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   console.log(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       console.log(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f, c = 0;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     console.log('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = parseInt(data.toString().trim());
    return;
  }
  var b;
  var Nums = data.toString().trim().split(' ');
  for (var i = 0; i < Nums.length; i++) {
    if (((parseInt(Nums[0]) + parseInt(Nums[1]) + parseInt(Nums[2])) / 2) == parseInt(Nums[i])) {
      b = true;
      break;
    } else {
      b = false;
    }
  }
  if (b) {
    console.log('YES');
  } else {
    console.log('NO');
  }
  c++
  if (c == f) {
    process.exit();
  }
})

// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   console.log(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       console.log(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f, c = 0;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     console.log('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = parseInt(data.toString().trim());
    return;
  }
  var b;
  var Nums = data.toString().trim().split(' ');
  for (var i = 0; i < Nums.length; i++) {
    if (((parseInt(Nums[0]) + parseInt(Nums[1]) + parseInt(Nums[2])) / 2) == parseInt(Nums[i])) {
      b = true;
      break;
    } else {
      b = false;
    }
  }
  if (b) {
    console.log('YES\n');
  } else {
    console.log('NO\n');
  }
  c++
  if (c == f) {
    process.exit();
  }
})

// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   console.log(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       console.log(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f, c = 0;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     console.log('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = parseInt(data.toString().trim());
    console.log(f);
    return;
  }
  var b;
  var Nums = data.toString().trim().split(' ');
  for (var i = 0; i < Nums.length; i++) {
    if (((parseInt(Nums[0]) + parseInt(Nums[1]) + parseInt(Nums[2])) / 2) == parseInt(Nums[i])) {
      b = true;
      break;
    } else {
      b = false;
    }
  }
  if (b) {
    console.log('YES\n');
  } else {
    console.log('NO\n');
  }
  c++
  if (c == f) {
    process.exit();
  }
})

// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   console.log(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       console.log(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     console.log('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = 1;
    return;
  }
  var b;
  var Nums = data.toString().trim().split(' ');
  for (var i = 0; i < Nums.length; i++) {
    if (((parseInt(Nums[0]) + parseInt(Nums[1]) + parseInt(Nums[2])) / 2) == parseInt(Nums[i])) {
      b = true;
      break;
    } else {
      b = false;
    }
  }
  if (b) {
    console.log('YES\n');
  } else {
    console.log('NO\n');
  }
})

// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   console.log(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       console.log(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     console.log('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = 1;
    return;
  }
  var Nums = data.toString().trim().split();
  if (((Nums[0] + Nums[1]) == Nums[2]) || ((Nums[0] + Nums[2]) == Nums[1]) || ((Nums[1] + Nums[2]) == Nums[0])) {
    console.log('Yes\n');
  } else {
    console.log('NO\n');
  }
})

// let Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], z = -1, f;
// process.stdin.on('data', function (data) {
//   var d = data.toString().trim().replaceAll(' ', '\n')
//   var splittedSTR = d.split('')
//   console.log(splittedSTR);
//   let output = [];
//   if (splittedSTR.length == 1) {
//     if (f == undefined) {
//       f = data.toString().trim();
//     } else {
//     }
//     return;
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     if (splittedSTR[i + 1] == 0 && splittedSTR[i + 2] != 0) {
//       splittedSTR[i] = `${splittedSTR[i - 1] + splittedSTR[i]}`;
//       splittedSTR.splice(i + 1, 1)
//       splittedSTR.splice(i - 1, 1)
//     }
//   }
//   for (var i = 0; i < splittedSTR.length; i++) {
//     output.push(Alpha[splittedSTR[i] - 1])
//     if (output.length == splittedSTR.length) {
//       console.log(output.join(''));
//       z++
//       if (z == f) {
//         process.exit();
//       }
//       return output.join('');
//     }
//   }
// })
var f;
// process.stdin.on('data', function (data) {
//   if (f == undefined) {
//     f = 1;
//     return;
//   }
//   var phrase = data.toString().trim().toLowerCase().split(' ');
//   if (phrase[0] == phrase[1]) {
//     console.log('=\n');
//     return '=';
//   }
//   if (!data.toString().trim().toLowerCase().includes('s')) {
//     if (phrase[0].includes('m') && phrase[1].includes('l')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].includes('l') && phrase[1].includes('m')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     }
//   } else {
//     if (phrase[0].includes('m') && phrase[1].includes('s')) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].includes('s') && phrase[1].includes('m')) {
//       console.log('<\n');
//       return '<';
//     } else if (phrase[0].match(/x/g).length < phrase[1].match(/x/g).length) {
//       console.log('>\n');
//       return '>';
//     } else if (phrase[0].match(/x/g).length > phrase[1].match(/x/g).length) {
//       console.log('<\n');
//       return '<';
//     }
//   }
// })
process.stdin.on('data', function (data) {
  if (f == undefined) {
    f = 1;
    return;
  }
  var Nums = data.toString().trim().split();
  if (((Nums[0] * Nums[1]) == Nums[2]) || ((Nums[0] * Nums[2]) == Nums[1]) || ((Nums[1] * Nums[2]) == Nums[0])) {
    console.log('Yes\n');
  } else {
    console.log('NO\n');
  }
})

'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function main(){
    const testNumbers = readline()

    for(let i = 0; i<testNumbers; i++){
        solve(readline().split(" ").map(x=>parseInt(x)))
    }
}

function solve(input){
    console.log(
        input.includes(Math.abs(input[0]-input[1]))
        ||
        input.includes(Math.abs(input[0]-input[2]))
        ||
        input.includes(Math.abs(input[1]-input[2])) ? 'YES':'NO'
    )
}

'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function main(){
    const testNumbers = readline()

    for(let i = 0; i<testNumbers; i++){
        solve(readline().split(" ").map(x=>parseInt(x)));
    }
}

function solve(input){
    console.log(
        input.includes(Math.abs(input[0]-input[1]))
        ||
        input.includes(Math.abs(input[0]-input[2]))
        ||
        input.includes(input[1]-input[2]) ? 'YES':'NO'
    )
}

const fs = require('fs');
const input = fs.readFileSync(0, 'utf8').trim().split('\n');

let currentline = 0;
function readline(){
    return input[currentline++];
}

let T = readline();
for(let i = 1; i <= T; i++){
    let [a, b, c] = readline().split(' ').map(Number);
    console.log(solve(a, b, c));
}

function solve(a, b, c){
    return a + b === c || b + c === a || a + c === b;
}

// run on javascript V8 4.8.0
// https://codeforces.com/contest/1742/problem/A
// You are given three integers a, b, and c. Determine if one of them is the sum of the other two.
function main() {
    var tn = +readline(); // Number of test cases
    for (var i = 0; i < tn; i++) {

        var a = readline().split(' ').map(Number);
        // Call solve()
        solve(a);
    }
}

function solve(a) {
    var a = a.sort(function(a, b){return a-b});
    if (a[0] + a[1] == a[2]) {
        print('YES');
    } else {
        print('NO');
    }
}

// main();

var tests = +readline();

for(var i=0; i<tests; i++) {
    var input = readline().split(" ");
    var num1 = parseInt(input[0]);
    var num2 = parseInt(input[1]);
    var num3 = parseInt(input[3]);
    if((num1 + num2 == num3) || (num1 + num3 == num2) || (num3 + num2 == num1)) {
        print("YES");
    }else {
        print("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 q = +lines[l++]
        const qs = lines.slice(l, l + q).map(str => str.trim().split(' ').map((x, i) => i < 2 ? +x : x))
        l += q
        output[i] = solve(qs)
    }
    console.log(output.join('\n'))
// })()
})
class Queue {
    constructor() {
        this.map = {}
        this.first = 0
        this.last = -1
    }
    push(...args) {
        let i = 0
        if (!this.length) {
            this.first = this.last = 0
            this.map[this.first] = args[i++]
        }
        for (; i < args.length; i++) {
            this.map[++this.last] = args[i]
        }
    }
    unshift(...args) {
        let i = 0
        if (!this.length) {
            this.first = this.last = 0
            this.map[this.first] = args[i++]
        }
        for (; i < args.length; i++) {
            this.map[--this.first] = args[i]
        }
    }
    pop() {
        const r = this.map[this.last]
        delete this.map[this.last]
        this.last--
        return r
    }
    shift() {
        const r = this.map[this.first]
        delete this.map[this.first]
        this.first++
        return r
    }
    get length() {
        if (this.first > this.last) return 0
        return this.last - this.first + 1
    }
    get(x) {
        return this.map[this.first + x]
    }
    getLast() {
        return this.map[this.last]
    }
    forEach(fn) {
        for (let i = this.first; i <= this.last; i++) {
            fn(this.map[i], i - this.first)
        }
    }
}

function solve(qs) {
    const s = Array(26).fill(0)
    s[0] = 1
    const t = Array(26).fill(0)
    t[0] = 1
    return qs.map(([type, k, x]) => {
        let add
        if (type === 1) {
            add = s
        } else {
            add = t
        }
        for (let i = 0; i < x.length; i++) {
            const j = x.charCodeAt(i) - 'a'.charCodeAt(0)
            add[j] += k
        }
        // console.log(s, t)
        const sch = []
        const tch = []
        for (let i = 0; i < s.length; i++) {
            if (s[i]) sch.push(i)
            if (t[i]) tch.push(i)
        }
        if (!sch.length) return 'YES'
        if (!tch.length) return 'NO'
        if (sch[0] < tch[tch.length - 1]) return 'YES'
        if (sch[0] > tch[tch.length - 1]) return 'NO'
        if (sch.length > 1) return 'NO'
        if (tch.length > 1) return 'NO'
        const a = s[sch[0]]
        const b = t[tch[0]]
        return a < b ? 'YES' : 'NO'
    }).join('\n')
}

'use strict';

var fs = require('fs');

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

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

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  const n = rn();
  const res = new Array(n);
  const cnt1 = new Array(26).fill(0),
        cnt2 = new Array(26).fill(0);
  let sum1 = 1,
      sum2 = 1;
  cnt1[0] = 1;
  cnt2[0] = 1;
  let flag = false;
  next: for (let i = 0; i < n; i++) {
    const d = rn(),
          k = rn(),
          s = read();
    if (!flag) {
      for (let j = 0; j < s.length; j++) {
        if (d === 1) {
          cnt1[s[j].charCodeAt(0) - 97] += k;
          sum1 += k;
        } else {
          if (s[j] !== 'a') {
            flag = true;
            break;
          }
          cnt2[s[j].charCodeAt(0) - 97] += k;
          sum2 += k;
        }
      }
    }
    if (flag) {
      res[i] = 'YES';
    } else {
      let p1 = 0,
          p2 = 0;
      for (let j = 0; j < 26; j++) {
        p1 += cnt1[j];
        p2 += cnt2[j];
        if (cnt1[j] !== cnt2[j]) {
          if (cnt1[j] < cnt2[j] && p1 === sum1 || cnt1[j] > cnt2[j] && p2 !== sum2) {
            res[i] = 'YES';
            continue next;
          }
          break;
        }
      }
      res[i] = 'NO';
    }
  }
  return res.join('\n');
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rn();
    return res;
  };
  const re = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rn() - 1;
    return res;
  };
  const rbs = n => {
    let res = new Array(n);
    for (let i = 0; i < n; i++) res[i] = rb();
    return res;
  };
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  const [rn, rb, rns, re, rbs] = convertInput(r);
  try {
    let t = rn();
    let res = new Array(t);
    let limit = 0;
    for (let i = 0; i < t; i++) {
      var _solve;
      const s = (_solve = solve(r)) !== null && _solve !== void 0 ? _solve : '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      } else {
        res[i] = s;
      }
    }
    if (t >= limit) {
      return res.join('\n');
    } else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8')
.split(/\s+/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();

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 q = +lines[l++]
        const qs = lines.slice(l, l + q).map(str => str.trim().split(' ').map((x, i) => i < 2 ? +x : x))
        l += q
        output[i] = solve(qs)
    }
    console.log(output.join('\n'))
// })()
})
class Queue {
    constructor() {
        this.map = {}
        this.first = 0
        this.last = -1
    }
    push(...args) {
        let i = 0
        if (!this.length) {
            this.first = this.last = 0
            this.map[this.first] = args[i++]
        }
        for (; i < args.length; i++) {
            this.map[++this.last] = args[i]
        }
    }
    unshift(...args) {
        let i = 0
        if (!this.length) {
            this.first = this.last = 0
            this.map[this.first] = args[i++]
        }
        for (; i < args.length; i++) {
            this.map[--this.first] = args[i]
        }
    }
    pop() {
        const r = this.map[this.last]
        delete this.map[this.last]
        this.last--
        return r
    }
    shift() {
        const r = this.map[this.first]
        delete this.map[this.first]
        this.first++
        return r
    }
    get length() {
        if (this.first > this.last) return 0
        return this.last - this.first + 1
    }
    get(x) {
        return this.map[this.first + x]
    }
    getLast() {
        return this.map[this.last]
    }
    forEach(fn) {
        for (let i = this.first; i <= this.last; i++) {
            fn(this.map[i], i - this.first)
        }
    }
}

function solve(qs) {
    const s = Array(26).fill(0)
    s[0] = 1
    const t = Array(26).fill(0)
    t[0] = 1
    return qs.map(([type, k, x]) => {
        let add
        if (type === 1) {
            add = s
        } else {
            add = t
        }
        for (let i = 0; i < x.length; i++) {
            const j = x.charCodeAt(i) - 'a'.charCodeAt(0)
            add[j] += k
        }
        // console.log(s, t)
        const sch = []
        const tch = []
        for (let i = 0; i < s.length; i++) {
            if (s[i]) sch.push(i)
            if (t[i]) tch.push(i)
        }
        if (!sch.length) return 'YES'
        if (!tch.length) return 'NO'
        if (sch[0] < tch[tch.length - 1]) return 'YES'
        if (sch[0] > tch[tch.length - 1]) return 'NO'
        // if (sch.length > 1) return 'NO'
        // if (tch.length > 1) return 'NO'
        const a = s[sch[0]]
        const b = t[tch[0]]
        // console.log(s, t)
        if (a < b) {
            return sch.length > 1 ? 'NO' : 'YES'
        } else if (a > b) {
            // return tch.length > 1 ? 'NO' : 'YES'
            return 'NO'
        } else {
            // return sch.length > 1 ? 'NO' : 'YES'
            return 'NO'
        }
    }).join('\n')
}

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 q = +lines[l++]
        const qs = lines.slice(l, l + q).map(str => str.trim().split(' ').map((x, i) => i < 2 ? +x : x))
        l += q
        output[i] = solve(qs)
    }
    console.log(output.join('\n'))
// })()
})
class Queue {
    constructor() {
        this.map = {}
        this.first = 0
        this.last = -1
    }
    push(...args) {
        let i = 0
        if (!this.length) {
            this.first = this.last = 0
            this.map[this.first] = args[i++]
        }
        for (; i < args.length; i++) {
            this.map[++this.last] = args[i]
        }
    }
    unshift(...args) {
        let i = 0
        if (!this.length) {
            this.first = this.last = 0
            this.map[this.first] = args[i++]
        }
        for (; i < args.length; i++) {
            this.map[--this.first] = args[i]
        }
    }
    pop() {
        const r = this.map[this.last]
        delete this.map[this.last]
        this.last--
        return r
    }
    shift() {
        const r = this.map[this.first]
        delete this.map[this.first]
        this.first++
        return r
    }
    get length() {
        if (this.first > this.last) return 0
        return this.last - this.first + 1
    }
    get(x) {
        return this.map[this.first + x]
    }
    getLast() {
        return this.map[this.last]
    }
    forEach(fn) {
        for (let i = this.first; i <= this.last; i++) {
            fn(this.map[i], i - this.first)
        }
    }
}

function solve(qs) {
    const s = Array(26).fill(0)
    const t = Array(26).fill(0)
    return qs.map(([type, k, x]) => {
        let add
        if (type === 1) {
            add = s
        } else {
            add = t
        }
        for (let i = 0; i < x.length; i++) {
            const j = x.charCodeAt(i) - 'a'.charCodeAt(0)
            add[j] += k
        }
        // console.log(s, t)
        const sch = []
        const tch = []
        for (let i = 0; i < s.length; i++) {
            if (s[i]) sch.push(i)
            if (t[i]) tch.push(i)
        }
        if (!sch.length) return 'YES'
        if (!tch.length) return 'NO'
        if (sch[0] < tch[tch.length - 1]) return 'YES'
        if (sch[0] > tch[tch.length - 1]) return 'NO'
        if (sch.length > 1) return 'NO'
        if (tch.length > 1) return 'NO'
        const a = s[sch[0]]
        const b = t[tch[0]]
        return a < b ? 'YES' : 'NO'
    }).join('\n')
}

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 q = +lines[l++]
        const qs = lines.slice(l, l + q).map(str => str.trim().split(' ').map((x, i) => i < 2 ? +x : x))
        l += q
        output[i] = solve(qs)
    }
    console.log(output.join('\n'))
// })()
})
class Queue {
    constructor() {
        this.map = {}
        this.first = 0
        this.last = -1
    }
    push(...args) {
        let i = 0
        if (!this.length) {
            this.first = this.last = 0
            this.map[this.first] = args[i++]
        }
        for (; i < args.length; i++) {
            this.map[++this.last] = args[i]
        }
    }
    unshift(...args) {
        let i = 0
        if (!this.length) {
            this.first = this.last = 0
            this.map[this.first] = args[i++]
        }
        for (; i < args.length; i++) {
            this.map[--this.first] = args[i]
        }
    }
    pop() {
        const r = this.map[this.last]
        delete this.map[this.last]
        this.last--
        return r
    }
    shift() {
        const r = this.map[this.first]
        delete this.map[this.first]
        this.first++
        return r
    }
    get length() {
        if (this.first > this.last) return 0
        return this.last - this.first + 1
    }
    get(x) {
        return this.map[this.first + x]
    }
    getLast() {
        return this.map[this.last]
    }
    forEach(fn) {
        for (let i = this.first; i <= this.last; i++) {
            fn(this.map[i], i - this.first)
        }
    }
}

function solve(qs) {
    const s = Array(26).fill(0)
    const t = Array(26).fill(0)
    return qs.map(([type, k, x]) => {
        let add
        if (type === 1) {
            add = s
        } else {
            add = t
        }
        for (let i = 0; i < x.length; i++) {
            const j = x.charCodeAt(i) - 'a'.charCodeAt(0)
            add[j] += k
        }
        // console.log(s, t)
        const sch = []
        const tch = []
        for (let i = 0; i < s.length; i++) {
            if (s[i]) sch.push(i)
            if (t[i]) tch.push(i)
        }
        if (!sch.length) return 'YES'
        if (sch[0] < tch[tch.length - 1]) return 'YES'
        if (sch.length > 1) return 'NO'
        const a = s[sch[0]]
        const b = t[tch[0]]
        return a < b ? 'YES' : 'NO'
    }).join('\n')
}


var n = parseInt(readline());
var plusArr = [];
var minusArr = [];
for (var i = 0; i < n; i++) {
  var numbers = readline().split(" ").map(function(x) { return parseInt(x); });
  if (numbers[0] > 0) {
    plusArr.push({
      x: numbers[0],
      a: numbers[1]
    })
  }
  else {
    minusArr.push({
      x: Math.abs(numbers[0]),
      a: numbers[1]
    })
  }
}

function sortfunction(a, b){
  return (a.x - b.x)
}

plusArr.sort(sortfunction);
minusArr.sort(sortfunction);

var sum = 0;
var min = Math.min(plusArr.length, minusArr.length);
plusArr.forEach(function(apple, i) {
  if (i <= min)
    sum = sum + apple.a;
});
minusArr.forEach(function(apple, i) {
  if (i <= min)
    sum = sum + apple.a;
});

print(sum);

function main() {
    var n = parseInt(readline()),
        rightList = {}, leftList = {}, result = 0;

    for(var index = 0; index < n; index++)  {
        var XAi = readline().split(/\s/gi).map(Number);

        if(XAi[0] < 0)  {
            rightList[XAi[0]] = XAi[1];
        } else  {
            leftList[XAi[0]] = XAi[1];
        }
    }

    var leftPos = Object.keys(leftList).map(Number).sort(function(a, b) { return a - b }),
        rightPos = Object.keys(rightList).map(Number).sort(function(a, b) { return b - a });

    if(rightPos.length > leftPos.length)  {
        leftPos.forEach(function(pos)   {
            result += leftList[pos];
        });

        rightPos.some(function(pos, index)   {
            if(index <= leftPos.length)  {
                result += rightList[pos];
            } else  {
                return true;
            }
        });
    } else if(rightPos.length < leftPos.length)   {
        rightPos.forEach(function(pos)   {
            result += rightList[pos];
        });

        leftPos.some(function(pos, index)   {
            if(index <= rightPos.length)  {
                result += leftList[pos];
            } else  {
                return true;
            }
        });
    } else  {
        leftPos.forEach(function(pos)   {
            result += leftList[pos];
        });

        rightPos.forEach(function(pos)   {
            result += rightList[pos];
        });
    }

    print(result);
};

Array.prototype.getLastValue = function()   {
    return this[this.length - 1];
};

main();

var n = parseInt(readline());
var plusArr = [];
var minusArr = [];
for (var i = 0; i < n; i++) {
  var numbers = readline().split(" ").map(function(x) { return parseInt(x); });
  if (numbers[0] > 0) {
    plusArr.push({
      x: numbers[0],
      a: numbers[1]
    })
  }
  else {
    minusArr.push({
      x: Math.abs(numbers[0]),
      a: numbers[1]
    })
  }
}
plusArr.sort();
minusArr.sort();

var sum = 0;
if ((Math.abs(plusArr.length - minusArr.length) == 0) || (Math.abs(plusArr.length - minusArr.length) == 1)) {
  plusArr.forEach(function(apple) {
    sum = sum + apple.a;
  });
  minusArr.forEach(function(apple) {
    sum = sum + apple.a;
  });
}
else if (plusArr.length > minusArr.length) {
  for (var i=0; i < minusArr.length + 1; i++) {
    sum = sum + plusArr[i].a;
  }
}
else {
  for (var i=0; i < plusArr.length + 1; i++) {
    sum = sum + minusArr[i].a;
  }
}

print(sum);

function main() {
    var n = parseInt(readline()),
        rightList = [ 0 ], leftList = [ 0 ], result = 0;

    for(var index = 0; index < n; index++)  {
        var XAi = readline().split(/\s/gi).map(Number);

        if(XAi[0] < 0)  {
            rightList.push(rightList.getLastValue() + XAi[1]);
        } else  {
            leftList.push(leftList.getLastValue() + XAi[1]);
        }
    }

    if(rightList.length > leftList.length)  {
        result = leftList.getLastValue() + rightList[leftList.length];
    } else if(rightList.length < leftList.length)   {
        result = rightList.getLastValue() + leftList[rightList.length];
    } else  {
        result = rightList.getLastValue() + leftList.getLastValue();
    }

    print(result);
};

Array.prototype.getLastValue = function()   {
    return this[this.length - 1];
};

main();


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

function solve(n, k, str) {
    const a = 'a'.charCodeAt(0)
    //
    const dp = Array(n)//.fill(-1)
    let p = 0
    let pp = -1, pto
    while (p < n && k >= 0) {
        if (dp[p]) {
            p++
            continue
        }

        const connect = str.charCodeAt(p) - str.charCodeAt(pp)
        let cost, to
        if (pp >= 0 && k >= connect) {
            cost = connect
            to = pto
        } else {
            const max = str.charCodeAt(p) - a
            cost = Math.min(max, k)
            to = String.fromCharCode(str.charCodeAt(p) - cost)
        }
        k -= cost
    // console.log(str[p], to, cost)
        for (let i = 0; i < str.length; i++) {
            if (dp[i]) continue
            if (str[i] <= str[p]) {
                // dp[i] = p
                if (str[i] >= to) {
                    dp[i] = to
                } else {
                    dp[i] = str[i]
                }
            }
        }
        pp = p
        pto = to
        //
        p++
    }
    return dp.join('')
}

const lines = [];
const rl = require('readline').createInterface({ input: process.stdin, output: process.stdout });
rl.on('line', line => lines.push(line));
rl.on('close', main);
let rli = 0;
function readline() {
    return lines[rli++];
}

const ra = ()=>readline().split(' ').map(a=>+a);

function div(val, by){
    return (val - val % by) / by;
}

const cnk = (n, k) => {
    let res = 1;
    for (let i = 1; i <= k; i++)
        res = res * (n - k + i) / i;
    return Math.round(res + 0.01);
}

const sumab = (a, b) => {
    let x = (b - a + 1);
    let y = a + b;
    if (x % 2 === 0) {
        x = Math.round(x / 2);
    } else {
        y = Math.round(y / 2);
    }
    return BigInt(x) * BigInt(y);
}

const calc = (n, k, a)=>{
    // if (k > 25) {
    //     let result = new Array(n).fill('a');
    //     return result.join('');
    // }

    let charmap = {};

    let aCode = 'a'.charCodeAt(0);

    for (let i = 0; i < n; i++) {
        charmap[a[i]] = a[i];
    }

    for (let i = 0; i < n; i++) {
        if (k <= 0) break;
        let curchar = charmap[a[i]];
        let idx = curchar.charCodeAt(0) - aCode;

        if (idx === 0) continue;
        let diff = Math.min(idx, k);
        let newchar = String.fromCharCode(aCode + (idx - diff));
        // console.log(`DEBUG newchar`, newchar);

        let found = false;

        for (let j = 1; j <= diff; j++) {
            let c = String.fromCharCode(aCode + (idx - j));
            // console.log(`DEBUG j ${j} c`, c);
            if (!!charmap[c] && charmap[c] !== c) {
                let nextchar = charmap[c];
                // console.log(`DEBUG j ${j} nextchar`, nextchar);
                for (let q = 0; q <= j; q++) {
                    let cc = String.fromCharCode(aCode + (idx - j + q));
                    charmap[cc] = nextchar;
                }

                k -= j;
                found = true;
                break;
            }
        }
        if (found) continue;

        k -= diff;

        for (let j = 0; j <= diff; j++) {
            let c = String.fromCharCode(aCode + (idx - j));
            charmap[c] = newchar;
        }
        // console.log(`DEBUG charmap`, charmap);
    }

    for (let i = 0; i < n; i++) {
        a[i] = charmap[a[i]];
    }
    return a.join('');
};

function main() {
    let T = +readline();
    for (let t = 1; t <= T; t++){
        // let n = +readline();
        let [n, k] = ra();
        let a = readline().split('');
        console.log(`${calc(n, k, a)}`);
    }
}

'use strict';
// HEADER:
const print = console.log;
let IS_MULTITEST, testN;
const pcalc = testN=>{
  let res = calc(testN);
  if (Array.isArray(res)){
    pa(res);
  } else if (Number.isFinite(res) || typeof res=='string'){
    print(res);
  }
};

const main = ()=>{
  if (IS_MULTITEST){
    let T = +readline()
    for (testN=1; testN<=T; testN++)
      pcalc(T);
  } else
   pcalc();
};

const lines = [];
const rl = require('readline').createInterface({
   input: process.stdin, output: process.stdout});
rl.on('line', line=>{
  lines.push(line);
});
rl.on('close', main);
let rli = 0;
const readline = ()=>lines[rli++];
const L = process.env.DEBUG ? console.log : ()=>{};
const LT = obj=>L(`Test #${testN}`, obj);

const ra = ()=>readline().split(' ').map(a=>+a)
const pa = arr=>print(arr.join(' '));

// SOLUTION:
IS_MULTITEST = 1;

const calc = ()=>{
  // READING:
  let [n, k] = ra();
  let S = readline().split('');
  LT({n, k, S});
  // PROCESSING:
  let get_prev = (ch)=>{
    if (ch!='a'){
      return String.fromCharCode(ch.charCodeAt(0)-1)
    }
  };
  let covered = {};
  let ops = 0;
  for (let i=0; i<n && ops<k; i++){
    let ch = S[i];
    while (ch!='a' && ops<k){
      if (!covered[ch])
        ops++;
      covered[ch] = 1;
      ch = get_prev(ch);
    }
  }
  L({covered})
  let res = '';
  for (let i=0; i<n; i++){
    let ch = S[i];
    while (ch!='a' && covered[ch]){
      ch = get_prev(ch);
    }
    res += ch;
  }
  return res;
};

'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, s) {
  const nums = s.split('').map(char => char.charCodeAt(0) - 97);
  let pre = 0;
  for (let i = 0; i < n; i++) {
    if (nums[i] === 97) continue;
    let cur = nums[i];
    while (m && nums[i] > pre) {
      m--;
      let num = nums[i];
      for (let j = i; j < n; j++) {
        if (nums[j] === num) nums[j]--;
      }
    }
    if (nums[i] === pre) {
      for (let j = i; j < n; j++) {
        if (nums[j] === pre) nums[j] = 0;
      }
    }
    pre = Math.max(cur, pre);
    if (!m) {
      break;
    }
  }
  console.log(nums.map(num => String.fromCharCode(num + 97)).join(''));
}

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

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, s) {
  const nums = s.split('').map(char => char.charCodeAt(0) - 97);
  let pre = 0;
  for (let i = 0; i < n; i++) {
    if (nums[i] === 97) continue;
    let cur = nums[i];
    while (m && nums[i] > pre) {
      m--;
      let num = nums[i];
      for (let j = i; j < n; j++) {
        if (nums[j] === num) nums[j]--;
      }
    }
    pre = Math.max(cur, pre);
    if (!m) {
      break;
    }
  }
  console.log(nums.map(num => String.fromCharCode(num + 97)).join(''));
}

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

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

const lines = [];
const rl = require('readline').createInterface({ input: process.stdin, output: process.stdout });
rl.on('line', line => lines.push(line));
rl.on('close', main);
let rli = 0;
function readline() {
    return lines[rli++];
}

const ra = ()=>readline().split(' ').map(a=>+a);

function div(val, by){
    return (val - val % by) / by;
}

const cnk = (n, k) => {
    let res = 1;
    for (let i = 1; i <= k; i++)
        res = res * (n - k + i) / i;
    return Math.round(res + 0.01);
}

const sumab = (a, b) => {
    let x = (b - a + 1);
    let y = a + b;
    if (x % 2 === 0) {
        x = Math.round(x / 2);
    } else {
        y = Math.round(y / 2);
    }
    return BigInt(x) * BigInt(y);
}

const calc = (n, k, a)=>{
    // if (k > 25) {
    //     let result = new Array(n).fill('a');
    //     return result.join('');
    // }

    let charmap = {};

    let aCode = 'a'.charCodeAt(0);

    for (let i = 0; i < n; i++) {
        charmap[a[i]] = a[i];
    }

    for (let i = 0; i < n; i++) {
        if (k <= 0) break;
        let curchar = charmap[a[i]];
        let idx = curchar.charCodeAt(0) - aCode;

        if (idx === 0) continue;
        let diff = Math.min(idx, k);
        let newchar = String.fromCharCode(aCode + (idx - diff));
        // console.log(`DEBUG newchar`, newchar);

        let found = false;

        for (let j = 1; j < diff; j++) {
            let c = String.fromCharCode(aCode + (idx - j));
            // console.log(`DEBUG j ${j} c`, c);
            if (!!charmap[c] && charmap[c] !== c) {
                let nextchar = charmap[c];
                // console.log(`DEBUG j ${j} nextchar`, nextchar);
                for (let q = 0; q <= j; q++) {
                    let cc = String.fromCharCode(aCode + (idx - j + q));
                    charmap[cc] = nextchar;
                }

                k -= j;
                found = true;
                break;
            }
        }
        if (found) continue;

        k -= diff;

        for (let j = 0; j < diff; j++) {
            let c = String.fromCharCode(aCode + (idx - j));
            charmap[c] = newchar;
        }
        // console.log(`DEBUG charmap`, charmap);
    }

    for (let i = 0; i < n; i++) {
        a[i] = charmap[a[i]];
    }
    return a.join('');
};

function main() {
    let T = +readline();
    for (let t = 1; t <= T; t++){
        // let n = +readline();
        let [n, k] = ra();
        let a = readline().split('');
        console.log(`${calc(n, k, a)}`);
    }
}


process.stdin.resume();
process.stdin.setEncoding('utf8');
let standardInputString = '';
let curLine = 0;

const readLine = () => {
  return standardInputString[curLine++];
};

process.stdin.on('data', rawData => {
  standardInputString += rawData;
});

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

  main();
});

/**
 * Test cases.
 *
 * 5
 * 1 15 // 15
 * 3 16 // 8
 * 5 19 // 6
 * 4 20 // 6
 * 1000000000 1 // 0
 */

// https://codeforces.com/contest/1566/problem/A
const main = () => {
    const t = +readLine();

    for (let _ = 0; _ < t; _ += 1) {
        const [n, s] = readLine().split(' ');

        const ans = Math.floor(
            s / Math.floor(n / 2 + 1),
        );

        console.log(ans);
    }
};

var limit = parseInt(readline());
for (var i = 0; i < limit; i++)
{
    var caseArray = readline().split(" ");
    var terms = parseInt(caseArray[0]);
    var total = parseInt(caseArray[1]);
    var div = Math.floor(terms/2) + 1;
    var result = Math.floor(total/div);
    print(result);
}

function readStringArray() {
		return readline().split(' ');
	}
	function readNumArray() {
		return readStringArray().map(Number);
	}

	function main() {
		var testCasesNum = +readline();
		for (var i = 0; i < testCasesNum; i++) {
			var ns = readStringArray();
			var n = ns[0];
			var s = ns[1];
			var ind = n % 2 ? Math.floor(n / 2) : Math.floor(n / 2) - 1;
			var res = Math.floor(s / (n - ind));
			print(res);
		}
	}

	main();

//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] = BigInt(next());
		}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 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 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();
	while(hasNext()){
		var N = nextInt();
		var S = nextInt();
		var size = Math.ceil((N + 1) / 2);
		myout(Math.floor(S / size));
	}
}


var num = readline().split(' ')
var n = parseInt(num[0])
var m = parseInt(num[1])
var arr = readline().split(' ')

// var arr1 = []
// for(var i=0; i<n; i++) {
//     arr1.push(parseInt(arr[i]))
// }

//print(arr1.length)
var sum1 = 0, sum2 = 0;
for(var i=0; i<n; i++) {
        sum1 += parseInt(arr[i])
}
var b, k=-999
for(var i=0; i<n-1; i++) {
    sum2 += parseInt(arr[i])
    b = (sum2%m) + ((sum1-sum2)%m)
    k = Math.max(k,b)
}
//var k = (sum1%m) + (sum2%m)
print(k)

var num = readline().split(' ')
var n = parseInt(num[0])
var m = parseInt(num[1])
var arr = readline().split(' ')

var arr1 = []
for(var i=0; i<n; i++) {
    arr1.push(parseInt(arr[i]))
}

//print(arr1.length)
var sum1 = 0, sum2 = 0;
for(var i=0; i<n; i++) {
        sum1 += arr1[i]
}
var b, k=-999
for(var i=0; i<n-1; i++) {
    sum2 += arr1[i];
    b = (sum2%m) + ((sum1-sum2)%m)
    k = Math.max(k,b)
}
//var k = (sum1%m) + (sum2%m)
print(k)

//var input = readline()

var num = readline().split(' ')
var n = parseInt(num[0])
var m = parseInt(num[1])
var arr = readline().split(' ')

var arr1 = []
for(var i=0; i<n; i++) {
    arr1.push(parseInt(arr[i]))
}
//print(arr1.length)
var sum1 = 0, sum2 = 0;
for(var i=0; i<n; i++) {
    if(i<(n/2)) {
        sum1 += arr1[i]
    }
    else {
        sum2 += arr1[i]
    }
}
//print(sum1 +' '+ sum2)
var k = (sum1%m) + (sum2%m)
print(k)


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

function solve(n, k) {
    let cur = 1n
    let h = 0n
    while (cur < k) {
    // while (cur < n) {
        cur += k < cur ? k : cur
        h++
    }
    // return h
    return h + ceil(n - cur, k)
}
function ceil(a, b) {
    const k = a / b
    return a / b + (k * b < a ? 1n : 0n)
}

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

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

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

		let tot = 1n, hr = 0n;
		while (tot < k) {
			tot *= 2n;
			hr++;
		}

		if (tot < n) {
			hr += (n-tot+k-1n)/ k;
		}

		console.log(hr.toString());
	}
}

const solve = (n,k)=>{
     let i = 0n,cable = 1n;
     while(cable<k){
          cable*=2n;
          i++;
     }
     if(cable<n){
          let t = (n-cable)+k-1n;
          i+=(t/k);
     }
     console.log(i+"");
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let [n,k] =  readline().trim().split(" ").map(cur=>BigInt(cur));
       solve(n,k);
  }
}
main();

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

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

function ceilDiv (a, b)  {
	let res = a / b;
	if (res*b != a)
		res++;
	return res;
}

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

		let tot = 1n, hr = 0n;
		while (tot < n) {
			const cablesToUse = tot;
			if (cablesToUse >= k) {
				hr += ceilDiv(n-tot, k);
				break;
			}

			tot += cablesToUse;
			hr++;
		}

		console.log(hr.toString());
	}
}

const solve = (n,k)=>{
     if(n===1n){
          console.log(0);
          return;
     }
     if(k===1n){
          console.log((n-1n)+"");
          return;
     }
     let l,j = n&(n-1n),cnt=0,h=n;
     if(j===0n){
          while(h!==1n){
               cnt++;
               h = h>>1n;
          }
     }
     else{
          while(h!==0n){
               cnt++;
               h = h>>1n;
          }
     }
     if(cnt<=k) {
          console.log(cnt+"");
          return;
     }
     h1 = n-((1n<<(k-1n))+k);
     if((h1)%k===0n) console.log(k+((h1)/k)+"");
     else console.log(k+((h1)/k)+1n+"");
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let [n,k] =  readline().trim().split(" ").map(cur=>BigInt(cur));
       solve(n,k);
  }
}
main();

const solve = (n,k)=>{
     if(n===1n){
          console.log(0);
          return;
     }
     if(k===1n){
          console.log((n-1n)+"");
          return;
     }
     let l,j = n&(n-1n),cnt;
     if(j===0n) cnt = 1n;
     else cnt = 0n;
     let h = n,h1;
     while(h!==0n){
          cnt++;
          h = h>>1n;
     }
     if(cnt<=k) {
          console.log(cnt+"");
          return;
     }
     h1 = n-((1n<<(k-1n))+k);
     if((h1)%k===0n) console.log(k+((h1)/k)+"");
     else console.log(k+((h1)/k)+1n+"");
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let [n,k] =  readline().trim().split(" ").map(cur=>BigInt(cur));
       solve(n,k);
  }
}
main();

const solve = (n,k)=>{
     if(n===1n){
          console.log(0);
          return;
     }
     if((k===1n)||(n===2n)){
          console.log((n-1n)+"");
          return;
     }
     let l,j = n^(n-1n);
     if(j===0n) l = 1n;
     else l = 0n;
     let cnt = 0n,h = n,h1;
     while(h!==l){
          cnt++;
          h = h>>1n;
     }
     if(cnt<=k) {
          console.log(cnt+"");
          return;
     }
     h1 = n-((1n<<(k-1n))+k);
     if((h1)%k===0n) console.log(k+((h1)/k)+"");
     else console.log(k+((h1)/k)+1n+"");
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let [n,k] =  readline().trim().split(" ").map(cur=>BigInt(cur));
       solve(n,k);
  }
}
main();

const solve = (n,k)=>{
     if(n===1n){
          console.log(0);
          return;
     }
     if(k===1n){
          console.log((n-1n)+"");
          return;
     }
     let t;
     for(let i=1n;i<=k;i++){
          t = ((i *(i+1n))/2n)+1n;
          if(t>=n){
               console.log(i+"");
               return;
          }
     }
     let h = n-t;
     if(h%k===0n) console.log(k+(h/k)+"");
     else console.log(k+(h/k)+1n+"");
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let [n,k] =  readline().trim().split(" ").map(cur=>BigInt(cur));
       solve(n,k);
  }
}
main();

const solve = (n,k)=>{
     if(n===1n){
          console.log(0);
          return;
     }
     if(k===1n){
          console.log((n-1n)+"");
          return;
     }
     let t;
     for(let i=1n;i<=k;i++){
          t = ((i *(i+1n))/2n)+1n;
          if(t>=n){
               console.log(i+"");
               return;
          }
     }
     let h = n-t;
     if((n-t)%k===0) console.log(k+(h/k)+"");
     else console.log(k+(h/k)+1n+"");
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let [n,k] =  readline().trim().split(" ").map(cur=>BigInt(cur));
       solve(n,k);
  }
}
main();

const solve = (n,k)=>{
     if(n===1n){
          console.log(0);
          return;
     }
     if(k===1n){
          console.log((n-1n)+"");
          return;
     }
     if(k>=n/2n){
          console.log((n/2n)+"");
          return;
     }
     let h = k*2n;
     let res = n-h;
     if(res%k===0n) console.log(k+(res/k)+"");
     else console.log(k+(res/k)+1n+"")
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let [n,k] =  readline().trim().split(" ").map(cur=>BigInt(cur));
       solve(n,k);
  }
}
main();

const solve = (n,k)=>{
     if(n===1n){
          console.log(0);
          return;
     }
     if(k===1n){
          console.log((n-1n)+"");
          return;
     }
     if(k>=n/2n){
          if(n%2n===0n) console.log((n/2n)+"");
          else console.log((n/2n)+1n+"");
          return;
     }
     let h = k*2n;
     let res = n-h;
     if(res%k===0n) console.log(k+(res/k)+"");
     else console.log(k+(res/k)+1n+"")
}
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for(let i=0;i<t;i++){
       let [n,k] =  readline().trim().split(" ").map(cur=>BigInt(cur));
       solve(n,k);
  }
}
main();

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

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

function ceilDiv (a, b)  {
	let res = a / b;
	if (res*b != a)
		res++;
	return res;
}

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

		let tot = 1n, hr = 0;
		while (tot < n) {
			const cablesToUse = tot;
			if (cablesToUse >= k) {
				hr += Number(ceilDiv(n-tot, k));
				break;
			}

			tot += cablesToUse;
			hr++;
		}

		console.log(hr);
	}
}

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

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

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

		let tot = 1, hr = 0;
		while (tot < n) {
			const cablesToUse = Math.min(tot, k);
			if (cablesToUse == k) {
				hr += Math.ceil((n-tot)/k);
				break;
			}

			tot += cablesToUse;
			hr++;
		}

		console.log(hr);
	}
}


var input = readline().split(' ').map(Number), n = input[0];
var arr = ['a', 'b', 'c', 'd'];
for (var i = 0; i < n; i++) {
    write(arr[i % 4]);
}