const nextString = (function() {
  const listeners = [], strings = [], ps = process.stdin
  let last = ''
  ps.setEncoding('utf8')
  ps.on('readable', () => {
    let chunk
    while ((chunk = ps.read()) !== null) {
      chunk = (last + chunk).split(/\r\n|\r|\n/)
      last = chunk[chunk.length - 1]
      for (let i = 0; i < chunk.length - 1; ++i) {
        if (chunk[i].length > 0) {
          if (listeners.length > 0) {
            listeners.shift(1)(chunk[i])
          }
          else {
            strings.push(chunk[i])
          }
        }
      }
    }
  })
  const fn = resolve => {
    if (strings.length > 0) {
      resolve(strings.shift(1))
    }
    else {
      listeners.push(resolve)
    }
  }
  return () => new Promise(fn)
})()

async function proc() {
  let n = +await nextString();
  let mas = (await nextString()).split(' ').map(x => +x).sort((a, b) => a - b)
  let qq
  for (qq = 0; qq < n && mas[qq] <= 0; ++qq) {}
  if (qq === 0) {
    return 1
  }
  if (qq === 1) {
    return n === 1 ? 1 : 2
  }
  if (qq === n) {
    return qq
  }
  let min = mas[1] - mas[0]
  for (let i = 2; i <= qq; ++i) {
    min = Math.min(min, mas[i] - mas[i - 1])
  }
  if (mas[qq] <= min) {
    return qq + 1
  }
  return qq

}

async function main() {
  let t = +await nextString()
  for (let i = 0; i < t; ++i) {
    console.log(await proc())
  }
}

main()

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

let lines = [];
let lineIdx = 0;

rl.on("line", line => {
    lines.push(line);
});

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

function readLine() {
    return lines[lineIdx++];
}

function main() {
    let t = +readLine();
    while (t--) {
        let n = +readLine();
        let a = readLine().split(' ').map(x => +x).sort((x, y) => x - y);
        let diff = Infinity;
        let hasPos = false;
        let ret = 0;
        for (let i=0; i<n; i++) {
            if (a[i] <= 0) {
                ret++;
                if (i > 0)
                    diff = Math.min(diff, a[i] - a[i-1]);
            } else if (diff >= a[i] && !hasPos) {
                ret++;
                hasPos = true;
            }
        }
        console.log(ret);
    }
}

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var os = require('os');

const stdin = process.stdin;
const stdout = process.stdout;
class InputAndOutput {
    constructor() {
        this.lineIndex = 0;
        this.lines = [];
    }
    dried() {
        return this.lineIndex >= this.lines.length;
    }
    readLine() {
        const line = this.lines[this.lineIndex];
        this.lineIndex += 1;
        return line;
    }
    print(content) {
        stdout.write(content);
    }
    async init() {
        const lines = await this.readLines();
        this.lines = lines;
    }
    readLines() {
        const buffers = [];
        return new Promise(resolve => {
            stdin.on('data', (buffer) => buffers.push(buffer));
            stdin.on('end', function () {
                const inputs = buffers.join('');
                const lines = inputs.split(os.EOL);
                resolve(lines);
            });
        });
    }
}
async function __main__(handle) {
    const io = new InputAndOutput();
    await io.init();
    handle(io);
}

function solution(nums) {
    nums.sort((x, y) => x - y);
    if (nums[0] > 0)
        return 1;
    if (nums[nums.length - 1] <= 0)
        return nums.length;
    let i = 1;
    let minimumPositiveValue = -1;
    let minimumDelta = 2e9 + 7;
    for (; i < nums.length; ++i) {
        if (nums[i] > 0) {
            minimumPositiveValue = nums[i];
            break;
        }
        minimumDelta = Math.min(minimumDelta, nums[i] - nums[i - 1]);
    }
    if (minimumDelta >= minimumPositiveValue)
        return i + 1;
    return i;
}
__main__(function (io) {
    const T = Number(io.readLine());
    for (let kase = 1; kase <= T; ++kase) {
        const countOfNums = Number(io.readLine());
        const nums = io
            .readLine()
            .trim()
            .split(/\s+/g)
            .map(x => Number(x))
            .slice(0, countOfNums);
        const answer = solution(nums);
        io.print('' + answer + '\n');
    }
});

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ncnt = 0;
    for (let i = 0; i < n; i++) if (arr[i] <= 0) ncnt++;
    arr.sort((a, b) => b - a);
    let min = Infinity;
    for (let i = 0; i < n; i++) if (arr[i] > 0) min = Math.min(min, arr[i]);
    if (min === Infinity) console.log(ncnt);
    else {
      let flag = true;
      for (let i = 1; i < n; i++)
        if (arr[i] <= 0) flag &= arr[i - 1] - arr[i] >= min;
      if (flag) console.log(ncnt + 1);
      else console.log(ncnt);
    }
  }
};
solve();

//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 list = nextIntArray(N);
		list.sort(function(a,b){
			return a - b;
		});
		var output = 1;
		var min = Math.pow(10, 15);
		var isZero = false;
		//myerr(list);
		for(var i = 1; i < N; i++){
			if(list[i] < 0){
				min = Math.min(min, Math.abs(list[i - 1] - list[i]));
				output++;
			}else{
				if(list[i] <= Math.min(min, Math.abs(list[i - 1] - list[i]))){
					output++;
					min = Math.min(min, Math.abs(list[i - 1] - list[i]));

				}else{
					break;
				}
			}
		}
		myout(output);
	}
}

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ncnt = 0;
    for (let i = 0; i < n; i++) if (arr[i] <= 0) ncnt++;
    arr.sort((a, b) => b - a);
    let min = Infinity;
    for (let i = 0; i < n; i++) if (arr[i] > 0) min = Math.min(min, arr[i]);
    if (min === Infinity) console.log(ncnt);
    else {
      let flag = true;
      for (let i = 1; i < n - 1; i++)
        if (arr[i] <= 0) flag &= arr[i - 1] - arr[i] >= min;
      if (flag) console.log(ncnt + 1);
      else console.log(ncnt);
    }
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ni = [],
      p = [];
    for (let i = 0; i < n; i++) {
      if (arr[i] < 0) ni.push(arr[i]);
      else p.push(arr[i]);
    }
    p.sort((a, b) => a - b);
    if (ni.length === 0) {
      let cnt = 0;
      for (let i = 0; i < p.length; i++) {
        if (p[i] === 0) cnt++;
        else {
          if(cnt>1) break;
          cnt++;
          break;
        }
      }
      console.log(cnt);
    } else if (p.length === 0) console.log(ni.length);
    else {
      ni.sort((a, b) => b - a);
      let res = [];
      if (ni.length === 1) {
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else {
            if (res.length > 1) break;
            res.push(p[i]);
            break;
          }
        }
        console.log(ni.length + res.length);
      } else {
        let d = Infinity;
        for (let i = 0; i < ni.length - 1; i++)
          d = Math.min(d, Math.abs(ni[i] - ni[i + 1]));
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else if (p[i] <= d) {
            res.push(p[i]);
            break;
          } else break;
        }
        console.log(ni.length + res.length);
      }
    }
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ni = [],
      p = [];
    for (let i = 0; i < n; i++) {
      if (arr[i] < 0) ni.push(arr[i]);
      else p.push(arr[i]);
    }
    p.sort((a, b) => a - b);
    if (ni.length === 0) {
      let cnt = 0;
      for(let i=0;i<p.length;i++){
        if(p[i]===0) cnt++;
        else{
          cnt++;
          break;
        }
      }
      console.log(cnt);
    } else if (p.length === 0) console.log(ni.length);
    else {
      ni.sort((a, b) => b - a);
      let res = [];
      if (ni.length === 1) {
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else {
            if (res.length > 1) break;
            res.push(p[i]);
            break;
          }
        }
        console.log(ni.length + res.length);
      } else {
        let d = Infinity;
        for (let i = 0; i < ni.length - 1; i++)
          d = Math.min(d, Math.abs(ni[i] - ni[i + 1]));
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else if (p[i] <= d) {
            res.push(p[i]);
            break;
          } else break;
        }
        console.log(ni.length + res.length);
      }
    }
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ni = [],
      p = [];
    for (let i = 0; i < n; i++) {
      if (arr[i] < 0) ni.push(arr[i]);
      else p.push(arr[i]);
    }
    p.sort((a, b) => a - b);
    if (ni.length === 0) {
      if(p[0]===0) console.log(2);
      else console.log(1);
    }
    else if (p.length === 0) console.log(ni.length);
    else {
      ni.sort((a, b) => b - a);
      let res = [];
      if (ni.length === 1) {
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else {
            if (res.length > 1) break;
            res.push(p[i]);
            break;
          }
        }
        console.log(ni.length + res.length);
      } else {
        let d = Infinity;
        for (let i = 0; i < ni.length - 1; i++)
          d = Math.min(d, Math.abs(ni[i] - ni[i + 1]));
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else if (p[i] <= d) {
            res.push(p[i]);
            break;
          } else break;
        }
        console.log(ni.length + res.length);
      }
    }
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ni = [],
      p = [];
    for (let i = 0; i < n; i++) {
      if (arr[i] < 0) ni.push(arr[i]);
      else p.push(arr[i]);
    }
    if (ni.length === 0) console.log(1);
    else if (p.length === 0) console.log(ni.length);
    else {
      ni.sort((a, b) => b - a);
      p.sort((a, b) => a - b);
      let res = [];
      if (ni.length === 1) {
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else {
            if (res.length > 1) break;
            res.push(p[i]);
            break;
          }
        }
        console.log(ni.length + res.length);
      } else {
        let d = Infinity;
        for (let i = 0; i < ni.length - 1; i++)
          d = Math.min(d, Math.abs(ni[i] - ni[i + 1]));
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else if (p[i] <= d) {
            res.push(p[i]);
            break;
          } else break;
        }
        console.log(ni.length + res.length);
      }
    }
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ni = [],
      p = [];
    for (let i = 0; i < n; i++) {
      if (arr[i] < 0) ni.push(arr[i]);
      else p.push(arr[i]);
    }
    if (ni.length === 0) console.log(1);
    else if (p.length === 0) console.log(ni.length);
    else {
      ni.sort((a, b) => b - a);
      p.sort((a, b) => a - b);
      let res = [];
      if (ni.length === 1) {
        res.push(p[0]);
        for (let i = 1; i < p.length; i++)
          if (res[res.length - 1] === p[i]) res.push(p[i]);
        console.log(ni.length + res.length);
      } else {
        let d = Infinity;
        for (let i = 0; i < ni.length - 1; i++)
          d = Math.min(d, Math.abs(ni[i] - ni[i + 1]));
        for (let i = 0; i < p.length; i++) {
          if (p[i] === 0) res.push(p[i]);
          else if (p[i] <= d) {
            res.push(p[i]);
            break;
          } else break;
        }
        console.log(ni.length + res.length);
      }
    }
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ni = [],
      p = [];
    for (let i = 0; i < n; i++) {
      if (arr[i] < 0) ni.push(arr[i]);
      else p.push(arr[i]);
    }
    if (ni.length === 0) console.log(1);
    else if (p.length === 0) console.log(ni.length);
    else {
      ni.sort((a, b) => b - a);
      p.sort((a, b) => a - b);
      let res = [];
      if (ni.length === 1) {
        res.push(p[0]);
        for (let i = 1; i < p.length; i++)
          if (res[res.length - 1] === p[i]) res.push(p[i]);
        console.log(ni.length + res.length);
      } else {
        let d = Infinity;
        for (let i = 0; i < ni.length - 1; i++)
          d = Math.min(d, Math.abs(ni[i] - ni[i + 1]));
        for (let i = 0; i < p.length; i++) {
          if (i === 0) {
            if (p[i] <= d) res.push(p[i]);
            else break;
          } else {
            if (p[i] <= d) {
              if (Math.abs(res[res.length - 1] - p[i]) === p[i]) res.push(p[i]);
              else break;
            } else break;
          }
        }
        console.log(ni.length + res.length);
      }
    }
  }
};
solve();

"use strict";
const fs = require("fs");
//let filename = "0.txt";
let filename = 0;
const input = fs.readFileSync(filename, "utf8").trim().split("\n");
let line = 0;
function readline() {
  return input[line++];
}

const solve = () => {
  let t = parseInt(readline());
  while (t--) {
    let n = parseInt(readline());
    let arr = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let ni = [],
      p = [];
    for (let i = 0; i < n; i++) {
      if (arr[i] < 0) ni.push(arr[i]);
      else p.push(arr[i]);
    }
    if (ni.length === 0) console.log(1);
    else if (p.length === 0) console.log(ni.length);
    else {
      ni.sort((a, b) => b - a);
      p.sort((a, b) => a - b);
      let res = [];
      if (ni.length === 1) {
        res.push(p[0]);
        for (let i = 1; i < p.length; i++)
          if (res[res.length - 1] === p[i]) res.push(p[i]);
        console.log(ni.length + res.length);
      } else {
        let d = Math.abs(ni[0] - ni[1]);
        for (let i = 0; i < p.length; i++) {
          if (i === 0) {
            if (p[i] <= d) res.push(p[i]);
            else break;
          } else {
            if (p[i] <= d) {
              if (Math.abs(res[res.length - 1] - p[i]) === p[i]) res.push(p[i]);
              else break;
            } else break;
          }
        }
        console.log(ni.length + res.length);
      }
    }
  }
};
solve();

const nextString = (function() {
  const listeners = [], strings = [], ps = process.stdin
  let last = ''
  ps.setEncoding('utf8')
  ps.on('readable', () => {
    let chunk
    while ((chunk = ps.read()) !== null) {
      chunk = (last + chunk).split(/\r\n|\r|\n/)
      last = chunk[chunk.length - 1]
      for (let i = 0; i < chunk.length - 1; ++i) {
        if (chunk[i].length > 0) {
          if (listeners.length > 0) {
            listeners.shift(1)(chunk[i])
          }
          else {
            strings.push(chunk[i])
          }
        }
      }
    }
  })
  const fn = resolve => {
    if (strings.length > 0) {
      resolve(strings.shift(1))
    }
    else {
      listeners.push(resolve)
    }
  }
  return () => new Promise(fn)
})()

async function proc() {
  let n = +await nextString();
  let mas = (await nextString()).split(' ').map(x => +x).sort((a, b) => a - b)
  let qq
  for (qq = 0; qq < n && mas[qq <= 0]; ++qq) {}
  if (qq === 0) {
    return 1
  }
  if (qq === 1) {
    return n === 1 ? 1 : 2
  }
  if (qq === n) {
    return qq
  }
  let min = mas[1] - mas[0]
  for (let i = 2; i <= qq; ++i) {
    min = Math.min(min, mas[i] - mas[i - 1])
  }
  if (mas[qq] <= min) {
    return qq + 1
  }
  return qq

}

async function main() {
  let t = +await nextString()
  for (let i = 0; i < t; ++i) {
    console.log(await proc())
  }
}

main()

const nextString = (function() {
  const listeners = [], strings = [], ps = process.stdin
  let last = ''
  ps.setEncoding('utf8')
  ps.on('readable', () => {
    let chunk
    while ((chunk = ps.read()) !== null) {
      chunk = (last + chunk).split(/\r\n|\r|\n/)
      last = chunk[chunk.length - 1]
      for (let i = 0; i < chunk.length - 1; ++i) {
        if (chunk[i].length > 0) {
          if (listeners.length > 0) {
            listeners.shift(1)(chunk[i])
          }
          else {
            strings.push(chunk[i])
          }
        }
      }
    }
  })
  const fn = resolve => {
    if (strings.length > 0) {
      resolve(strings.shift(1))
    }
    else {
      listeners.push(resolve)
    }
  }
  return () => new Promise(fn)
})()

async function proc() {
  let n = +await nextString();
  let mas = (await nextString()).split(' ').map(x => +x).sort((a, b) => a - b)
  let qq = mas.findIndex(x => x === 0)
  if (qq === -1) {
    for (qq = 0; qq < n && mas[qq < 0]; ++qq) {}
  }
  if (qq === 0) {
    return 1
  }
  if (qq === 1) {
    return n === 1 ? 1 : 2
  }
  if (qq === n) {
    return qq
  }
  let min = mas[1] - mas[0]
  for (let i = 2; i <= qq; ++i) {
    min = Math.min(min, mas[i] - mas[i - 1])
  }
  if (mas[qq] <= min) {
    return qq + 1
  }
  return qq

}

async function main() {
  let t = +await nextString()
  for (let i = 0; i < t; ++i) {
    console.log(await proc())
  }
}

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 list = nextIntArray(N);
		list.sort(function(a,b){
			return a - b;
		});
		var output = 1;
		var min = Math.pow(10, 15);
		var isZero = false;
		//myerr(list);
		for(var i = 1; i < N; i++){
			if(list[i] < 0){
				output++;
			}else{
				if(list[i] <= Math.min(min, Math.abs(list[i - 1] - list[i]))){
					output++;
					min = Math.min(min, Math.abs(list[i - 1] - list[i]));

				}else{
					break;
				}
			}
		}
		myout(output);
	}
}

//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 list = nextIntArray(N);
		list.sort(function(a,b){
			return a - b;
		});
		var output = 0;
		var isZero = false;
		for(var i = 0; i < N; i++){
			if(list[i] < 0){
				output++;
				max = list[i];
			}else if(list[i] == 0 && !isZero){
				isZero = true;
				output++;
			}else{
				output++;
				break;
			}
		}
		myout(output);
	}
}


let _inputLines;
let _lineNumber = 0;
let inputReader = _inputReader ();

function _main() {

	_inputLines = _inputData.trim().split('\n').map((string) => {
		return string.trim();
	});;

	let t = inputReader.readNumber();

	function solve(){
	    let  n, m, rb, cb, rd, cd ;
	    [ n, m, rb, cb, rd, cd ] = inputReader.readNumberArray();
	    let dirx = 1, diry = 1;
	    let ans = 0;
	    while(rb != rd && cb != cd){
	        if(rb + dirx > n || rb + dirx < 1) dirx*= -1;
	        if(cb + diry > m || cb + diry < 1) diry*= -1;
	        rb+=dirx;
	        cb+=diry;
	        ans+=1;
	    }
	    console.log(ans);
	}

	while(t--){
	    solve();
	}

}

var _inputData = '';
function cacheInput(data) {
	_inputData += data;
}

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', cacheInput).on('end', _main);

function _inputReader () {
	function readNumber(){
		return Number(_inputLines[_lineNumber++]);
	}

	function readNumberArray(){
		return _inputLines[_lineNumber++].split(' ').map(val => Number(val));
	}

	return {
		readNumber,
		readNumberArray,
	}
}

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 l = lines[i].split(' ').map(Number);
        var n = l[0], m = l[1], rb = l[2], cb = l[3], rd = l[4], cd = l[5];
        var ans = 0;
        var a = 1;
        var b = 1;
        while(true){
            if(rb == rd || cb == cd){
                break;
            }
            if(rb + a > n || rb + a < 1){
                a *= -1;
            }
            if(cb + b > m || cb + b < 1){
                b *= -1;
            }
            rb += a;
            cb += b;
            ans++;
        }
        console.log(ans);
    }
});

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);
        var n = k[0], m = k[1], rb = k[2], cb = k[3], rd = k[4], cd = k[5];
        var ans = 0;
        var dr = 1, dc = 1;
        while(true){
            if(rb == rd || cb == cd){
                break;
            }
            if(rb + dr > n || rb + dr < 1){
                dr *= -1;
            }
            if(cb  + dc > m || cb + dc < 1){
                dc *= -1;
            }
            rb += dr;
            cb += dc;
            ans++;
        }
        console.log(ans);
	}
});

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

const INF = 1e9;

function main () {
	let T = rn();
	while (T--) {
		const  [n, m, rb, cb, rd, cd] = rna();

		let ans = INF;
		if (rd >= rb)
			ans = Math.min(ans, rd - rb);
		else
			ans = Math.min(ans, n - rb + n - rd);

		if (cd >= cb)
			ans = Math.min(ans, cd - cb);
		else
			ans = Math.min(ans, m - cb + m - cd);

		console.log(ans);
	}
}

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

const getLine = (function () {
    const getLineGen = (async function* () {
        for await (const line of rl) {
            yield line;
        }
    })();
    return async () => {
        let next;
        do {
            next = (await getLineGen.next());
        } while (!next.done && next.value === '');
        return next.value;
    };
})();

let solve = async () => {
    const nsc = parseInt(await getLine());
    for(let sc = 0; sc < nsc; sc++) {
       let [n,m,rb,rc,rd,cd] = (await getLine()).split(' ').map(num => parseInt(num));
       let res = 0;
       let dr, dc;
       dr = 1; dc = 1;
       while (rb !== rd && rc !== cd) {
           if (rb + dr > n || rb + dr < 1)
               dr = dr * -1;
           if (rc + dc > m || rc + dc < 1)
               dc = dc * -1;
           rb += dr;
           rc += dc;
           res += 1;
       }
       console.log(res);
    }
}

solve();

var t = parseInt(readline());

  function solve() {
    var inp = readline()
      .split(" ")
      .map((data) => +data);
    var n = inp[0],
      m = inp[1],
      rb = inp[2],
      cb = inp[3],
      rd = inp[4],
      cd = inp[5];
    var ans = Infinity;
    if (rd >= rb) {
      ans = Math.min(ans, rd - rb);
    } else {
      ans = Math.min(ans, 2 * (n - rb) + rb - rd);
    }
    if (cd >= cb) {
      ans = Math.min(ans, cd - cb);
    } else {
      ans = Math.min(ans, 2 * (m - cb) + cb - cd);
    }
    return ans;
  }

  while (t--) {
    print(solve());
  }

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 l = lines[i].split(' ').map(Number);
        var n = l[0], m = l[1], rb = l[2], cb = l[3], rd = l[4], cd = l[5];
        var ans = 0;
        var a = 1;
        var b = 1;
        while(true){
            if(rb == rd || cb == cd){
                break;
            }
            if(rb + a > n || rb + a < 0){
                a *= -1;
            }else if(cb + b > m || cb + b < 0){
                b *= -1;
            }
            rb += a;
            cb += b;
            ans++;
        }
        console.log(ans);
    }
});

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 l = lines[i].split(' ').map(Number);
        var n = l[0], m = l[1], rb = l[2], cb = l[3], rd = l[4], cd = l[5];
        var ans = 0;
        var a = 1;
        var b = 1;
        while(true){
            if(rb == rd || cb == cd){
                break;
            }
            if(rb + a > n || rb + a < 1){
                a *= -1;
            }else if(cb + b > m || cb + b < 1){
                b *= -1;
            }
            rb += a;
            cb += b;
            ans++;
        }
        console.log(ans);
    }
});


"use strict";

var _slicedToArray = (function() {
  function sliceIterator(arr, i) {
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = undefined;
    try {
      for (
        var _i = arr[Symbol.iterator](), _s;
        !(_n = (_s = _i.next()).done);
        _n = true
      ) {
        _arr.push(_s.value);
        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"]) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }
    return _arr;
  }
  return function(arr, i) {
    if (Array.isArray(arr)) {
      return arr;
    } else if (Symbol.iterator in Object(arr)) {
      return sliceIterator(arr, i);
    } else {
      throw new TypeError(
        "Invalid attempt to destructure non-iterable instance"
      );
    }
  };
})();

function _toConsumableArray(arr) {
  if (Array.isArray(arr)) {
    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  } else {
    return Array.from(arr);
  }
}

var compose = function compose() {
  for (
    var _len = arguments.length, functions = Array(_len), _key = 0;
    _key < _len;
    _key++
  ) {
    functions[_key] = arguments[_key];
  }

  return function() {
    for (
      var _len2 = arguments.length, args = Array(_len2), _key2 = 0;
      _key2 < _len2;
      _key2++
    ) {
      args[_key2] = arguments[_key2];
    }

    return functions.reduce(function(currArgs, func) {
      return func(currArgs);
    }, args);
  };
};

var lineToStringArray = function lineToStringArray(str) {
  return str.split(" ");
};
var lineToNumberArray = function lineToNumberArray(str) {
  return lineToStringArray(str).map(function(num) {
    return parseInt(num, 10);
  });
};

var readNumbersLine = compose(
  readline,
  lineToNumberArray
);
var readStringsLine = compose(
  readline,
  lineToStringArray
);

var _readNumbersLine = readNumbersLine(),
  _readNumbersLine2 = _slicedToArray(_readNumbersLine, 1),
  n = _readNumbersLine2[0];

var arr = readNumbersLine();
var sortedArr = [].concat(_toConsumableArray(arr)).sort(function(a, b) {
  return a - b;
});
var j = 0;
var res = 0;

var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;

try {
  for (
    var _iterator = sortedArr.entries()[Symbol.iterator](), _step;
    !(_iteratorNormalCompletion = (_step = _iterator.next()).done);
    _iteratorNormalCompletion = true
  ) {
    var _ref = _step.value;

    var _ref2 = _slicedToArray(_ref, 2);

    var index = _ref2[0];
    var value = _ref2[1];

    while (sortedArr[index] >= sortedArr[j] && j < n) {
      j++;
    }
    if (j === n) {
      break;
    }
    res = index + 1;
    j++;
  }
} catch (err) {
  _didIteratorError = true;
  _iteratorError = err;
} finally {
  try {
    if (!_iteratorNormalCompletion && _iterator.return) {
      _iterator.return();
    }
  } finally {
    if (_didIteratorError) {
      throw _iteratorError;
    }
  }
}

write(res);

var n = readline();

var arr = readline().split(' ').map(Number);

//print(arr.join(' '));

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

//print(arr.join(' '));

var ans = 0;

for( var i=0, cnt = 1; i<n && cnt < n;  ) {
   if( arr[i] < arr[cnt]) {
       i++; cnt++; ans++;
   } else cnt++;
}

print(ans);

var n = readline();

var arr = readline().split(' ').map(Number);

//print(arr.join(' '));

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

//print(arr.join(' '));

var ans = 0;

for( var i=0, cnt = 1; i<n && cnt < n;  ) {
   if( arr[i] < arr[cnt]) {
       i++; cnt++; ans++;
   } else cnt++;
}

print(ans);

var n = readline();

var arr = readline().split(' ').map(Number);

//print(arr.join(' '));

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

//print(arr.join(' '));

var used = [];

for( var i=1; i<=100005; i++ ) {
    used.push(0);
}

var cnt = 1, ans = 0;

for( var i=0; i<=n; i++ ) {
    while ( cnt <= n && arr[i] >= arr[cnt] && !used[cnt]) {
        cnt++;
    }
    if( cnt > n ) {
        break;
    }
    if( arr[cnt] > arr[i] ) {
        //print(cnt + " " + arr[i] + " " + arr[cnt] );
        ans++;
        used[cnt++] = 1;
    }
}

print(ans);

function main() {
  const is = new Scanner();
  const n = is.nextInt();
  const sequence = is.nextArray();
  for (let i = 0; i < n; i += 1)
    sequence[i] = parseInt(sequence[i], 10);
  sequence.sort((a, b) => a - b);
  sequence.reverse();

  let answer = 0;
  for (let i = 0, j = 0; i < n; i += 1) {
    if (sequence[j] > sequence[i]) {
      j += 1;
      answer += 1;
    }
  }

  console.log(answer);
}

/*
 *  api stdin
 */

class Scanner {
  constructor() {
    this.index = 0;
    this.lines = stdinInput.trim().split('\n');
  }

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

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

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

  nextArray() {
    return this.nextLine().split(' ');
  }

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

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

var n = (+ readline ());
var a = readline ();
a = a.trim ().split ( ' ' );
for ( var i = 0; i < a.length; i ++ ) a [ i ] = Number ( a [ i ] );
a.sort ( function ( a, b ) { return a - b; } );
var pa = 0, pb = 1;
while ( pb < a.length ) {
    if ( a [ pb ] > a [ pa ] )
        pa ++;
    pb ++;
}
print ( pa );

var n = readline();

var arr = readline().split(' ').map(Number);

//print(arr.join(' '));

arr.sort(function ( x, y ) {
    return x > y;
});

//print(arr.join(' '));

var ans = 0;

for( var i=0, cnt = 1; i<n && cnt < n;  ) {
   if( arr[i] < arr[cnt]) {
       i++; cnt++; ans++;
   } else cnt++;
}

print(ans);

var n = readline();

var arr = readline().split(' ').map(Number);

//print(arr.join(' '));

arr.sort(function ( x, y ) {
    return x > y;
});

//print(arr.join(' '));

var used = [];

for( var i=1; i<=100005; i++ ) {
    used.push(0);
}

var cnt = 1, ans = 0;

for( var i=1; i<=n; i++ ) {
    while ( cnt <= n && arr[i] >= arr[cnt] ) {
        cnt++;
    }
    if( cnt > n ) {
        break;
    }
    if( arr[cnt] > arr[i] ) {
        //print(cnt + " " + arr[i] + " " + arr[cnt] );
        ans++;
        used[cnt++] = 1;
    }
}

print(ans);

var n = readline();

var arr = readline().split(' ').map(Number);

//print(arr.join(' '));

arr.sort(function ( x, y ) {
    return x > y;
});

//print(arr.join(' '));

var used = [];

for( var i=1; i<=100005; i++ ) {
    used.push(0);
}

var cnt = 1, ans = 0;

for( var i=0, cnt = 1; i<n && cnt < n;  ) {
   if( arr[i] < arr[cnt]) {
       i++; cnt++; ans++;
   } else cnt++;
}

print(ans);

var n = readline();

var arr = readline().split(' ').map(Number);

//print(arr.join(' '));

arr.sort(function ( x, y ) {
    return x > y;
});

//print(arr.join(' '));

var used = [];

for( var i=1; i<=100005; i++ ) {
    used.push(0);
}

var cnt = 1, ans = 0;

for( var i=0; i<=n; i++ ) {
    while ( cnt <= n && arr[i] >= arr[cnt] && !used[cnt]) {
        cnt++;
    }
    if( cnt > n ) {
        break;
    }
    if( arr[cnt] > arr[i] ) {
        //print(cnt + " " + arr[i] + " " + arr[cnt] );
        ans++;
        used[cnt++] = 1;
    }
}

print(ans);

var n = readline();

var arr = readline().split(' ').map(Number);

//print(arr.join(' '));

arr.sort(function ( x, y ) {
    return x > y;
});

//print(arr.join(' '));

var used = [];

for( var i=1; i<=100005; i++ ) {
    used.push(0);
}

var cnt = 1, ans = 0;

for( var i=0; i<=n; i++ ) {
    while ( cnt <= n && arr[i] >= arr[cnt] ) {
        cnt++;
    }
    if( cnt > n ) {
        break;
    }
    if( arr[cnt] > arr[i] ) {
        //print(cnt + " " + arr[i] + " " + arr[cnt] );
        ans++;
        used[cnt++] = 1;
    }
}

print(ans);


const n = Number(readline());
for (var i = n; i; i--) {
  var line = readline().split(" ");
  var hp = Number(line[0]);
  var a = Number(line[1]);
  var b = Number(line[2]);
  while (hp > 20 && a--)
    hp = (hp >> 1) + 10;
  print(hp <= b * 10 ? "YES" : "NO");
}

// Q: https://codeforces.com/contest/1337/problem/B

const readline = require('readline');

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

rl.on('line', lineInput => {
	input.push(lineInput);
});

rl.on('close', () => {
	const test = parseInt(input[0]);
	for (let t = 0; t < test; t++) {
		let vals = input[t+1].split(' ').map((a) => {return parseInt(a)});
		console.log(solution(vals[0], vals[1], vals[2]));
	}
});

function solution(x, n, m) {
	if (x <= m*10) {
		return 'YES';
	}
	for (let i = 0; i < n; i++) {
		x = Math.floor((x/2 + 10));
		if ( x <= m*10) {
			return 'YES';
		}
	}
	return 'NO';
}

'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function main() {
    const cases = readline();
    var i;
    for (i = 0; i < cases; i++) {
        const line = readline();
        var a = parseInt(line.split(" ")[0]);
        var b = parseInt(line.split(" ")[1]);
        var c = parseInt(line.split(" ")[2]);

        solve(a, b, c);
    }
}

function solve(hp, attack1, attack2) {
    while ((attack1 + attack2) > 0 && hp > 0) {
        var attack1Damage = Math.floor(hp/2);

        if (attack1 > 0 && (hp - attack1Damage) > 10) {
            hp = attack1Damage;
            hp += 10;
            attack1--;
            continue;
        } else if (attack2 > 0) {
            hp -= 10;
            attack2--;
            continue;
        } else {
            break;
        }
    }

    console.log(hp > 0 ? 'NO' : 'YES');
}

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

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

  let [x, n, m] = d.split(' ').map(Number);

  while (n > 0 && x > m * 10) {
    x = Math.floor(x / 2) + 10;
    n--;
  }

  x -= m * 10;

  if (x > 0) {
    console.log('NO');
  }
  else {
    console.log('YES');
  }

  c++;
});

const processData = (input) => {
    let exp = /\s+/;
    let arr = input.split(exp);
    let l = arr[0];
    arr = arr.slice(1);
    arr = arr.map(el => +el);
    for (let z = 0; z < l; z++) {
        let x = arr[0];
        let n = arr[1];
        let m = arr[2];
        while (x > 20 && n > 0) {
            x = Math.floor(x/2);
            x += 10;
            n--;
        }
        console.log(x <= m * 10 ? "YES" : "NO");
        arr = arr.slice(3);
    }
}

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});

"use strict";
exports.__esModule = true;
var str = "", lines = [], idxLine = 0;
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function (x) { str += x; });
process.stdin.on('end', function () {
    lines = str.trim().split('\n').map(function (x) { return x.trim(); });
    main();
});
function readline() {
    return lines[idxLine++];
}
var print = console.log;
//===============================
//===============================
function canSolve(x, n, m) {
    while (n > 0 && x > 20) {
        x = Math.floor(x / 2) + 10;
        n--;
    }
    while (m > 0 && x > 0) {
        x = x - 10;
        m--;
    }
    if (x <= 0)
        return true;
    return false;
}
function main() {
    var t = parseInt(readline());
    for (var _ = 0; _ < t; _++) {
        var _a = readline().split(' ').map(function (e) { return parseInt(e); }), x = _a[0], n = _a[1], m = _a[2];
        print(canSolve(x, n, m) ? 'YES' : 'NO');
    }
}

"use strict";
exports.__esModule = true;
var str = "", lines = [], idxLine = 0;
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function (x) { str += x; });
process.stdin.on('end', function () {
    lines = str.trim().split('\n').map(function (x) { return x.trim(); });
    main();
});
function readline() {
    return lines[idxLine++];
}
var print = console.log;
//===============================
//===============================
function canSolve(x, n, m) {
    while (n > 0 && x > 20) {
        x = Math.floor(x / 2) + 10;
        n--;
    }
    while (m > 0 && x > 0) {
        x = x - 10;
        m--;
    }
    if (x <= 0)
        return true;
    return false;
}
function main() {
    var e = parseInt(readline());
    for (var _ = 0; _ < e; _++) {
        var _a = readline().split(' ').map(function (e) { return parseInt(e); }), x = _a[0], n = _a[1], m = _a[2];
        print(canSolve(x, n, m) ? 'YES' : 'NO');
    }
}

"use strict";
exports.__esModule = true;
var str = "", lines = [], idxLine = 0;
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function (x) { str += x; });
process.stdin.on('end', function () {
    lines = str.trim().split('\n').map(function (x) { return x.trim(); });
    main();
});
function readline() {
    return lines[idxLine++];
}
var print = console.log;
//===============================
//===============================
function canSolve(x, n, m) {
    while (n > 0 && x > 20) {
        x = Math.floor(x / 2) + 10;
        n--;
    }
    while (m > 0 && x > 0) {
        x = x - 10;
        m--;
    }
    if (x <= 0)
        return true;
    return false;
}
function main() {
    var r = parseInt(readline());
    for (var _ = 0; _ < r; _++) {
        var _a = readline().split(' ').map(function (e) { return parseInt(e); }), x = _a[0], n = _a[1], m = _a[2];
        print(canSolve(x, n, m) ? 'YES' : 'NO');
    }
}

'use strict';

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

let inputString = '';
let currentLine = 0;

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

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

    main();
});

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

function checkValidity(a, b, c) {
  if ((a + b <= c) || (a + c <= b) || (b + c <= a)) {
    return false;
  } else {
    return true;
  }
}

function main() {
  let X = parseInt(readline());
  for (var cases = 0; cases < X; cases++) {
    let [h, v, l] = readline().split(" ").map(e => parseInt(e));

    while (h >= 0 && (v > 0 || l > 0)) {
      //console.log(h,v,l);
      if (v > 0 && h >= 21) {
        h = Math.floor(h/2) + 10;
        v--;
      } else if (l > 0) {
        h = h - 10;
        l--;
      } else {
        break;
      }
    }

    if (h > 0) {
      console.log('NO')
    } else {
      console.log('YES');
    }
  }
}

Main();
function myout(t){print(t);}//standard output
function next(){return readline();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す
//6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
//atcoderのサンプルは最後に改行入れること
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main() {
    var t = nextInt();
	var output = new Array(t);
	for(var i = 0; i < t; i++){
		var tmp = nextIntArray();
		var x = tmp[0];
		var n = tmp[1];
		var m = tmp[2];
		var mae = x;
		var isDefeat = false;
		for(var j = 0; j < n; j++){
			if(mae < Math.floor(x / 2) + 10){
				break;
			}
			x = Math.floor(x / 2) + 10;
		}
		for(var j = 0; j < m; j++){
			x -= 10;
			if(x <= 0){
				isDefeat = true;
			}
		}
		if(isDefeat){
			output[i] = "YES";
		}else{
			output[i] = "NO";
		}
	}
	myout(myconv(output,9));
}

var T = parseInt(readline());
while (T--) {
    var input1 = readline().split(' ').map(x => parseInt(x));
    var a = input1[0]
    var b = input1[1]
    var c = input1[2]
    if (0 >= (a - (c * 10))) {
        print("yes")
    }
    else {
        while (b--) {
            var r = parseInt(a / 2) + 10
            a = r
        }
        var res = a - (c * 10)
        if (res <= 0) {
            print("yes")
        }
        else {
            print("no")
        }
    }
}

var n = Number(readline());
var inp ;

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

    inp = readline().split(' ').map(cur => Number(cur));
    var h = inp[0];
    var v = inp[1];
    var l = inp[2];

if(h < 20){
while( l > 0 ){
    l--;
    h = lightning(h);
    if(h <= 0) break;
}
    (h <= 0) ? print("YES"): print("NO");

}else{
while(v > 0){
    v--;
h = voidAbs(h);
if(h < 20) break;
}
while( l > 0 ){
    l--;
    h = lightning(h);
    if(h <= 0) break;
}
    (h <= 0) ? print("YES"): print("NO");

}

}

function voidAbs(x){
    return Math.floor(x/2) + 10
}

function lightning(x){
    return x-10
}

var range = readline();

for(var i=0;i<range;i++) {
    var inputs = readline().split(" ").map((x) => parseInt(x));

    var score = inputs[0];
    var absorb = inputs[1];
    var strike = inputs[2];

    for(var j=0;j<absorb;j++) {
        if(score > 10) {
            score = Math.floor(score / 2) + 10;
        }
    }

    for(var j=0;j<strike;j++) {
        score = score - 10;
    }

    print(score > 0 ? 'NO': 'YES');

}

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

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

  let [x, n, m] = d.split(' ').map(Number);

  if (x <= 10) {
    [m, n] = [n, m];
  }

  while (n > 0) {
    x = Math.floor(x / 2) + 10;
    n--;
  }

  while (m > 0) {
    x -= 10;
    m--;
  }

  if (x > 0) {
    console.log('NO');
  }
  else {
    console.log('YES');
  }

  c++;
});

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

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

  let [x, n, m] = d.split(' ').map(Number);

  if (x <= 10) {
    [m, n] = [n, m];
  }

  while (n > 0) {
    x = Math.floor(x / 2) + 10;

    if (x <= 10) {
      break;
    }
    n--;
  }

  while (m > 0) {
    x -= 10;
    m--;
  }

  if (x > 0) {
    console.log('NO');
  }
  else {
    console.log('YES');
  }

  c++;
});

const processData = (input) => {
    let exp = /\s+/;
    let arr = input.split(exp);
    let l = arr[0];
    arr = arr.slice(1);
    arr = arr.map(el => +el);
    for (let z = 0; z < l; z ++){
        let x = arr[0];
        let n = arr[1];
        let m = arr[2];
        let val = m*10*Math.pow(2,n);
        console.log(val > x ? "YES" : "NO");
        arr = arr.slice(3);
    }
}

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});

const processData = (input) => {
    let exp = /\s+/;
    let arr = input.split(exp);
    let l = arr[0];
    arr = arr.slice(1);
    arr = arr.map(el => +el);
    for (let z = 0; z < l; z ++){
        let x = arr[0];
        let n = arr[1];
        let m = arr[2];
        while (x > 20 && n > 0){
            x/=2;
            x+=10;
            n--;
        }
        console.log(x < m*10 ? "YES" : "NO");
        arr = arr.slice(3);
    }
}

process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
    _input += input;
});

process.stdin.on("end", function () {
    processData(_input);
});


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 [r,g,b] = readline().split(' ');
        let ar = readline().split(' ');
        let ag = readline().split(' ');
        let ab = readline().split(' ');

        ar.sort((a,b) => parseInt(b)-parseInt(a));
        ag.sort((a,b) => parseInt(b)-parseInt(a));
        ab.sort((a,b) => parseInt(b)-parseInt(a));
        let dp = new Array(205);
        for(let i = 0; i < 205; i++){
            dp[i] = new Array(205);
            for(let j = 0; j < 205; j++){
                dp[i][j] = new Array(205);
                dp[i][j].fill(-1);
            }
        }
        let res = 0;
        let solve = (x, y, z) => {
            if((x >= r && y >= g) || (x >= r && z >= b) || (y >= g && z >= b))
                return 0;

            if(dp[x][y][z] !== -1)
                return dp[x][y][z];
            let max = 0;
            if(x < r && y < g)
                max = Math.max(max, parseInt(ar[x]) * parseInt(ag[y]) + solve(x+1, y+1, z));
            if(x < r && z < b)
                max = Math.max(max, parseInt(ar[x]) * parseInt(ab[z]) + solve(x+1, y, z+1));
            if(y < g && z < b)
                max = Math.max(max, parseInt(ag[y]) * parseInt(ab[z]) + solve(x, y+1, z+1));

            dp[x][y][z] = max;
            res = Math.max(res, max);
            return max;
        }

        solve(0,0,0);
        console.log(res);
}

'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 [r,g,b] = readline().split(" ").map(x => parseInt(x));
  const ar = readline().split(" ").map(x => parseInt(x));
  const ag = readline().split(" ").map(x => parseInt(x));
  const ab = readline().split(" ").map(x => parseInt(x));
  ar.sort((a,b)=>b-a);
  ag.sort((a,b)=>b-a);
  ab.sort((a,b)=>b-a);

  let ans = 0;
  let dp = Array(r+1).fill().map(
    _ => Array(g+1).fill().map(
      _ => Array(b+1).fill(0)));

  for (let i=0; i<=r; i++) {
    for (let j=0; j<=g; j++) {
      for (let k=0; k<=b; k++) {
        if (i<r && j<g) {
          dp[i+1][j+1][k] = Math.max(dp[i+1][j+1][k], dp[i][j][k] + ar[i]*ag[j]);
        }
        if (i<r && k<b) {
          dp[i+1][j][k+1] = Math.max(dp[i+1][j][k+1], dp[i][j][k] + ar[i]*ab[k]);
        }
        if (j<g && k<b) {
          dp[i][j+1][k+1] = Math.max(dp[i][j+1][k+1], dp[i][j][k] + ag[j]*ab[k]);
        }
        ans = Math.max(ans, dp[i][j][k]);
      }
    }
  }
  console.log(ans);
}

let input = ''

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

process.stdin.on('end', () => {
    let lines = input.trim().split('\n')

    lines.shift()
    let [r, g, b] = lines.map(l => l.split(' ').map(Number).sort((a, b) => b - a))

    let dp = new Array(r.length + 1)
    let ans = 0

    for (let i = 0; i <= r.length; i++) {
        dp[i] = new Array(g.length + 1)
        for (let j = 0; j <= g.length; j++) {
            dp[i][j] = new Array(b.length + 1).fill(0)
            for (let k = 0; k <= b.length; k++) {
                function upd(val) {
                    dp[i][j][k] = Math.max(dp[i][j][k], val)
                    ans = Math.max(ans, val)
                }
                if (i > 0 && j > 0)
                    upd(dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
                if (i > 0 && k > 0)
                    upd(dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
                if (j > 0 && k > 0)
                    upd(dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
            }
        }
    }

    console.log(ans)
})

var readline=require('readline');
var rl=readline.createInterface({
    input:process.stdin,
    output:process.stdout
});
var arr=[],sol;
function Solve(){
    this.val=0;
    this.dp=new Array(205);
    for(var i=0;i<205;i++){
        this.dp[i]=new Array(205);
        for(var j=0;j<205;j++) this.dp[i][j]=new Array(205).fill(0);
    }
}
Solve.prototype.dfs=function(i,j,k){
    if(i<0||j<0||k<0) return 0;
    if(this.dp[i][j][k]) return this.dp[i][j][k];
    var x=0,y=0,z=0;
    x=this.dfs(i-1,j-1,k)+(i>0&&j>0?(this.a[0][i-1]*this.a[1][j-1]):0);
    y=this.dfs(i-1,j,k-1)+(i>0&&k>0?(this.a[0][i-1]*this.a[2][k-1]):0);
    z=this.dfs(i,j-1,k-1)+(j>0&&k>0?(this.a[1][j-1]*this.a[2][k-1]):0);
    return this.val=this.dp[i][j][k]=Math.max(x,Math.max(y,z));
    return 0;
}
Solve.prototype.init=function(){
    this.a=new Array(3);
}
rl.on('line',function(inp){
    arr.push(inp);
    var len=arr.length;
    if(len===1){
        sol=new Solve();
        sol.rgb=arr[0].split(' ');
        sol.init();
        for(var i=0;i<sol.rgb.length;i++) sol.rgb[i]=parseInt(sol.rgb[i]);
    }else{
        var b=arr[len-1].split(' ');
        for(var i=0;i<sol.rgb[len-2];i++) b[i]=parseInt(b[i]);
        sol.a[len-2]=b;
        sol.a[len-2].sort(function(x,y){
            if(x<y) return -1;
            else if(x===y) return 0;
            else return 1;
        });
    }
    if(len===4){
        sol.dfs(sol.rgb[0],sol.rgb[1],sol.rgb[2]);
        console.log(sol.val);
        process.exit(0);
    }
});

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 [rNum, gNum, bNum] = readLine().split(/\s/).map(Number)
  const rs = readLine().split(/\s/).map(Number).sort((a, b) => b - a)
  const gs = readLine().split(/\s/).map(Number).sort((a, b) => b - a)
  const bs = readLine().split(/\s/).map(Number).sort((a, b) => b - a)
  const dp = Array(rNum + 1)
    .fill(0)
    .map(() => Array(gNum + 1)
      .fill(0)
      .map(() => Array(bNum + 1)
        .fill(0)
      )
    )
  let result = 0
  for (let r = 0; r <= rNum; r++) {
    for (let g = 0; g <= gNum; g++) {
	  for (let b = 0; b <= bNum; b++) {
        if ((r + g + b) % 2 === 1) {
          continue
        }
        if (r < rNum && g < gNum) {
          dp[r + 1][g + 1][b] = Math.max(dp[r + 1][g + 1][b], dp[r][g][b] + rs[r] * gs[g])
        }
        if (r < rNum && b < bNum) {
          dp[r + 1][g][b + 1] = Math.max(dp[r + 1][g][b + 1], dp[r][g][b] + rs[r] * bs[b])
        }
        if (g < gNum && b < bNum) {
          dp[r][g + 1][b + 1] = Math.max(dp[r][g + 1][b + 1], dp[r][g][b] + gs[g] * bs[b])
        }
        result = Math.max(result, dp[r][g][b])
      }
  	}
  }
  console.log(result)
}

'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 [r,g,b] = readline().split(" ").map(x => parseInt(x));
  const ar = readline().split(" ").map(x => parseInt(x));
  const ag = readline().split(" ").map(x => parseInt(x));
  const ab = readline().split(" ").map(x => parseInt(x));
  ar.sort((a,b)=>b-a);
  ag.sort((a,b)=>b-a);
  ab.sort((a,b)=>b-a);

  let area = 0;
  while (ar.length + ag.length + ab.length >1) {
    let [a,b,c] = [ar, ag, ab].sort((a,b)=>(b[0]|0)-(a[0]|0));
    let a0 = a.shift();
    let b0 = b.shift();
    // consider special case e.g. [3],[3],[2,2]
    // greedy way will do 3*3, leaving [2,2] unusable
    // the optimal matching is 3*2 + 3*2
    if (a.length == 0 && b.length == 0 && c.length >= 2) {
      if (a0 * c[0] + b0 * c[1] > a0*b0) {
        let c0 = c.shift();
        let c1 = c.shift();
        area += a0*c0 + b0*c1;
        break;
      }
    } else {
      area += a0 * b0;
    }
  }
  console.log(area);
}

'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 [r,g,b] = readline().split(" ").map(x => parseInt(x));
  const ar = readline().split(" ").map(x => parseInt(x));
  const ag = readline().split(" ").map(x => parseInt(x));
  const ab = readline().split(" ").map(x => parseInt(x));
  ar.sort((a,b)=>b-a);
  ag.sort((a,b)=>b-a);
  ab.sort((a,b)=>b-a);

  let area = 0;
  while (ar.length + ag.length + ab.length >1) {
    let [a,b,c] = [ar, ag, ab].sort((a,b)=>(b[0]|0)-(a[0]|0));
    let a0 = a.shift() | 0;
    let b0 = b.shift() | 0;
    // consider special case e.g. [3],[3],[2,2]
    // greedy way will do 3*3, leaving [2,2] unusable
    // the optimal matching is 3*2 + 3*2
    if (a.length == 0 && b.length == 0 && c.length >= 2) {
      if (a0 * c[0] + b0 * c[1] > a0*b0) {
        let c0 = c.shift();
        let c1 = c.shift();
        area += a0*c0 + b0*c1;
        break;
      }
    } else {
      area += a0 * b0;
    }
  }
  console.log(area);
}


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

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

function main() {
  let t = +readLine();
  while (t--) {
    const len = +readLine();
    const arr = [];
    for (let i = 1; i <= len; i++) arr.push(i);
    console.log(len);
    console.log(arr.join(" "));
  }
}

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

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	var output = new Array();
	for(var i = 0; i < t; i++){
		var N = nextInt();
		output.push(N);
		var list = [];
		for(var j = 1; j <= N; j++){
			list.push(j);
		}
		output.push(myconv(list, 8));
	}
	myout(myconv(output, 9));
}

function* range(first, last, step = 1) {
  for (let i = first; i <= last; i += step) {
    yield i;
  }
}

async function main() {
  const { EOL } = require('os');

  const dataArray = []
  for await (const chunk of process.stdin) {
    dataArray.push(chunk);
  }
  const lines = Buffer.concat(dataArray)
    .toString()
    .split(EOL)
    .filter(str => !!str)
    .map(str => +str);

  const output = [];
  for (let i = 1; i < lines.length; i++) {
    const n = lines[i];
    output.push(n - 1);
    output.push([...range(2, n)].join(' '));
  }
  console.log(output.join(EOL));
}

main();

function* range(first, last, step = 1) {
  for (let i = first; i <= last; i += step) {
    yield i;
  }
}

function checkState(state) {
  for (let i = 0; i + 1 < state.length; i++) {
    if (state[i] !== state[i + 1]) {
      return false;
    }
  }
  return true;
}

function solve(n) {
  let oldStates = [
    {
      state: [...range(1, n)],
      path: [],
    }
  ];
  for (const m of range(1, 1000)) {
    const newStates = [];
    for (const oldState of oldStates) {
      for (const i of range(0, n - 1)) {
        const newState = {
          state: [...oldState.state],
          path: [...oldState.path],
        }
        newState.path.push(i + 1);
        for (const j of range(0, n - 1)) {
          if (i !== j) {
            newState.state[j] += m;
          }
        }
        if (checkState(newState.state)) {
          return {
            m,
            a: newState.path,
          }
        }
        newStates.push(newState);
      }
    }
    oldStates = newStates;
  }
}

// function main() {
//   const a2 = solve(2);
//   const a3 = solve(3);
//   console.log('finished');
// }

// main();

async function main() {
  const { EOL } = require('os');

  const dataArray = []
  for await (const chunk of process.stdin) {
    dataArray.push(chunk);
  }
  const lines = Buffer.concat(dataArray)
    .toString()
    .split(EOL)
    .map(str => +str);

  const output = [];
  for (let i = 1; i < lines.length; i++) {
    const solution = solve(lines[i]);
    output.push(solution.m);
    output.push(solution.a.join(' '));
  }
  console.log(output.join(EOL));
}

main();

function* range(first, last, step = 1) {
  for (let i = first; i <= last; i += step) {
    yield i;
  }
}

function checkState(state) {
  for (let i = 0; i + 1 < state.length; i++) {
    if (state[i] !== state[i + 1]) {
      return false;
    }
  }
  return true;
}

function solve(n) {
  let oldStates = [
    {
      state: [...range(1, n)],
    }
  ];
  for (const m of range(1, 1000)) {
    const newStates = [];
    for (const oldState of oldStates) {
      for (const i of range(0, n - 1)) {
        const newState = {
          state: [...oldState.state],
          previous: oldState,
          path: i + 1,
        }
        for (const j of range(0, n - 1)) {
          if (i !== j) {
            newState.state[j] += m;
          }
        }
        if (checkState(newState.state)) {
          const a = [];
          let current = newState
          do {
            if (current.path) {
              a.push(current.path);
            }
            current = current.previous;
          } while (current);
          return {
            m,
            a,
          }
        }
        newStates.push(newState);
      }
    }
    oldStates = newStates;
  }
}

// function main() {
//   const a2 = solve(2);
//   const a3 = solve(3);
//   console.log('finished');
// }

async function main() {
  const { EOL } = require('os');

  const dataArray = []
  for await (const chunk of process.stdin) {
    dataArray.push(chunk);
  }
  const lines = Buffer.concat(dataArray)
    .toString()
    .split(EOL)
    .filter(str => !!str)
    .map(str => +str);

  const output = [];
  for (let i = 1; i < lines.length; i++) {
    const solution = solve(lines[i]);
    output.push(solution.m);
    output.push(solution.a.join(' '));
  }
  console.log(output.join(EOL));
}

main();

async function main() {
  const { EOL } = require('os');

  const dataArray = []
  for await (const chunk of process.stdin) {
    dataArray.push(chunk);
  }
  const lines = Buffer.concat(dataArray)
    .toString()
    .split(EOL)
    .map(str => +str);

  const output = [];
  for (let i = 1; i < lines.length; i++) {
    output.push(1);
    output.push(2);
  }
  console.log(output.join(EOL));
}

main();

function* range(first, last, step = 1) {
  for (let i = first; i <= last; i += step) {
    yield i;
  }
}

function checkState(state) {
  for (let i = 0; i + 1 < state.length; i++) {
    if (state[i] !== state[i + 1]) {
      return false;
    }
  }
  return true;
}

function solve(n) {
  let oldStates = [
    {
      state: [...range(1, n)],
      path: [],
    }
  ];
  for (const m of range(1, 1000)) {
    const newStates = [];
    for (const oldState of oldStates) {
      for (const i of range(0, n - 1)) {
        const newState = {
          state: [...oldState.state],
          path: [...oldState.path],
        }
        newState.path.push(i + 1);
        for (const j of range(0, n - 1)) {
          if (i !== j) {
            newState.state[j] += m;
          }
        }
        if (checkState(newState.state)) {
          return {
            m,
            a: newState.path,
          }
        }
        newStates.push(newState);
      }
    }
    oldStates = newStates;
  }
}

// function main() {
//   const a2 = solve(2);
//   const a3 = solve(3);
//   console.log('finished');
// }

// main();

async function main() {
  const dataArray = []
  for await (const chunk of process.stdin) {
    dataArray.push(chunk);
  }
  const lines = Buffer.concat(dataArray)
      .toString()
      .split(EOL)
      .map(str => +str);

  for (let i = 1; i < lines.length; i++) {
    const solution = solve(lines[i]);
    console.log(solution.m);
    console.log(solution.a.join(' '));
  }
}

main();

async function main() {
  const { EOL } = require('os');

  const dataArray = []
  for await (const chunk of process.stdin) {
    dataArray.push(chunk);
  }
  const lines = Buffer.concat(dataArray)
    .toString()
    .split(EOL)
    .filter(str => !!str)
    .map(str => +str);

  const output = [];
  for (let i = 1; i < lines.length; i++) {
    output.push(1);
    output.push(2);
  }
  console.log(output.join(EOL));
}

main();

function* range(first, last, step = 1) {
  for (let i = first; i <= last; i += step) {
    yield i;
  }
}

function checkState(state) {
  for (let i = 0; i + 1 < state.length; i++) {
    if (state[i] !== state[i + 1]) {
      return false;
    }
  }
  return true;
}

function solve(n) {
  let oldStates = [
    {
      state: [...range(1, n)],
      path: [],
    }
  ];
  for (const m of range(1, 1000)) {
    const newStates = [];
    for (const oldState of oldStates) {
      for (const i of range(0, n - 1)) {
        const newState = {
          state: [...oldState.state],
          path: [...oldState.path],
        }
        newState.path.push(i + 1);
        for (const j of range(0, n - 1)) {
          if (i !== j) {
            newState.state[j] += m;
          }
        }
        if (checkState(newState.state)) {
          return {
            m,
            a: newState.path,
          }
        }
        newStates.push(newState);
      }
    }
    oldStates = newStates;
  }
}

// function main() {
//   const a2 = solve(2);
//   const a3 = solve(3);
//   console.log('finished');
// }

// main();

async function main() {
  const dataArray = []
  for await (const chunk of process.stdin) {
    dataArray.push(chunk);
  }
  const lines = Buffer.concat(dataArray)
    .toString()
    .split(EOL)
    .map(str => +str);

  const output = [];
  for (let i = 1; i < lines.length; i++) {
    const solution = solve(lines[i]);
    output.push(solution.m);
    output.push(solution.a.join(' '));
  }
  console.log(output.join('\n'));
}

main();

async function main() {
  const { EOL } = require('os');

  const dataArray = []
  for await (const chunk of process.stdin) {
    dataArray.push(chunk);
  }
  const lines = Buffer.concat(dataArray)
    .toString()
    .split(EOL)
    .map(str => +str);

  const output = [];
  for (let i = 1; i < lines.length; i++) {
    output.push(1);
    output.push(1);
  }
  console.log(output.join(EOL));
}


// NYAN NYAN
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░░░░░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░░░░░░░░░
// ░░░░░░░░▄▀░░░░░░░░░░░░▄░░░░░░░▀▄░░░░░░░
// ░░░░░░░░█░░▄░░░░▄░░░░░░░░░░░░░░█░░░░░░░
// ░░░░░░░░█░░░░░░░░░░░░▄█▄▄░░▄░░░█░▄▄▄░░░
// ░▄▄▄▄▄░░█░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██░░
// ░██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██░░
// ░░▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██░
// ░░░░▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██░
// ░░░░░░░▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██░
// ░░░░░░░▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀░░
// ░░░░░░█▀▀█████████▀▀▀▀████████████▀░░░░
// ░░░░░░████▀░░███▀░░░░░░▀███░░▀██▀░░░░░░
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

// 백준의 노드 버전이 너무 낮아 babel 사용.
// 풀이는 solve() 함수에 있음.

const CODEFORCES_NODE = "cf";
const CODEFORCES_V8 = "cf-v8";
const BEAKJOON = "bj";
const TEST = "test";
// var SITE = BEAKJOON;
var SITE = CODEFORCES_NODE;
var DEBUG = false;

if(SITE == BEAKJOON){
  if (!String.prototype.startsWith) {
    String.prototype.startsWith = function(search, pos) {
      return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
    };
  }
  if (!String.prototype.endsWith) {
    String.prototype.endsWith = function(search, this_len) {
      if (this_len === undefined || this_len > this.length) {
        this_len = this.length;
      }
      return this.substring(this_len - search.length, this_len) === search;
    };
  }
  if (!String.prototype.repeat) {
    String.prototype.repeat = function(count) {
      'use strict';
      if (this == null) {
        throw new TypeError('can\'t convert ' + this + ' to object');
      }
      var str = '' + this;
      count = +count;
      if (count != count) {
        count = 0;
      }
      if (count < 0) {
        throw new RangeError('repeat count must be non-negative');
      }
      if (count == Infinity) {
        throw new RangeError('repeat count must be less than infinity');
      }
      count = Math.floor(count);
      if (str.length == 0 || count == 0) {
        return '';
      }
      // Ensuring count is a 31-bit integer allows us to heavily optimize the
      // main part. But anyway, most current (August 2014) browsers can't handle
      // strings 1 << 28 chars or longer, so:
      if (str.length * count >= 1 << 28) {
        throw new RangeError('repeat count must not overflow maximum string size');
      }
      var maxCount = str.length * count;
      count = Math.floor(Math.log(count) / Math.log(2));
      while (count) {
         str += str;
         count--;
      }
      str += str.substring(0, maxCount - str.length);
      return str;
    }
  }
}

String.prototype.replaceAt=function(index, replacement) {
  return this.substr(0, index) + replacement+ this.substr(index + replacement.length);
}

Function.prototype.repeat = function(times){
  for(let i = 0; i < times; i++){
    this();
  }
}

Array.prototype.getMaxConsecutiveSum = function(defaultValue = -Infinity){
  const N = this.length;
  let maxsum = defaultValue;
  let cursum = defaultValue;
  let cur;
  for(var ii = 0; ii < N; ii++){
    cur = this[ii];
    if(cursum + cur > 0){
      if(cur > cursum + cur){
        cursum = cur;
      } else cursum += cur;
    } else {
      cursum = cur;
      if(maxsum < cursum){
        maxsum = cursum;
      }
    }
    if(maxsum < cursum){
      maxsum = cursum;
    }
  }
  this.maxConsecutiveSum = maxsum;
  return maxsum;
}

try {
  require('manakin').global;
  // require ("babel-polyfill");
} catch (error) {

}
try {
  process.argv.forEach(function (val, index, array) {
    if (val.startsWith("site")) {
      switch (val.split("=")[1]) {
        case "test":
          // console.log('change site to test')
          SITE = TEST;
          break;
        case "cf-node":
          // console.log('change site to cf')
          SITE = CODEFORCES_NODE;
          break;
        case "cf":
          // console.log('change site to cf')
          SITE = CODEFORCES_NODE;
          break;
        case "cf-v8":
          // console.log('change site to cf')
          SITE = CODEFORCES_V8;
          break;
        case "bj":
          // console.log('change site to bj')
          SITE = BEAKJOON;
          break;
      }
    }
    if (val.startsWith("debug")) {
      switch (val.split("=")[1]) {
        case "true":
          DEBUG = true;
          break;
        case "false":
          DEBUG = false;
          break;
      }
    }
  });
} catch (error) {
}

let inputFilePath = '';
switch(SITE){
  case TEST:
    const config = require('config');
    var fs = require("fs");
    var path = require('path');
    inputFilePath = config.get('INPUTFILEPATH') || path.resolve(__dirname, "input.txt");
    break;
  default:
    inputFilePath = './input.txt';
    break;
}
const INPUTFILEPATH = inputFilePath;

// if (!String.prototype.endsWith) {
// 	String.prototype.endsWith = function(search, this_len) {
// 		if (this_len === undefined || this_len > this.length) {
// 			this_len = this.length;
// 		}
// 		return this.substring(this_len - search.length, this_len) === search;
// 	};
// }
// if (!Array.prototype.includes) {
//   Array.prototype.includes = function (target) {
//     return this.indexOf(target) !== -1
//   }
// }

const newLine = '\n';
var ans;
var inputText = "";
var lineCount = 0;
var lines;
var input;
var readline;
var getlines;
var lineOpen = false;
var readingLine = '';

var clockStart;
var clock;

var print;
print = console.log;
var it;
var step;
function EnableLogging(){
  it = console.info;
  step = console.success;
}
function DisableLogging(){
  it = function it(params) {
    return 0;
  }
  step = it;
}
if (DEBUG) {
  EnableLogging();
  clock = function(start) {
    if ( !start ) return process.hrtime();
    var end = process.hrtime(start);
    return Math.round((end[0]*1000) + (end[1]/1000000));
  }
} else {
  DisableLogging();
}

// prepares test data. to replace line input, assign arrays to lines variable.
function prepareTestData() {
  // it(lines);

  // lines = ['custom line 1', 'custom line 2'];
}

// executes exactly once for both test and run. execution time will be included to elapsed time.
const prepareSolve = () => {

}

function power(x, y) {    //분할 정복을 이용하여 x^y 구하기
  let ret = 1;
  while (y > 0) {
    if (y % 2) {
        ret *= x;
        ret %= P;
    }
    x *= x;
    x %= P;
    y /= 2;
  }
  return ret;
}

function createArray(lengths) {
  var arr = new Array(lengths || 0),
    i = lengths;
  if (arguments.length > 1) {
    var args = Array.prototype.slice.call(arguments, 1);
    while (i--) arr[lengths - 1 - i] = createArray.apply(this, args);
  }
  return arr;
}

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ MAIN SOLVE FUNCTION ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

function numericSortList(list){
  list.sort((a,b)=>a-b);
}

//[-1,1,-2,2,-3,3,...]
function solve(){
  const [n] = readInts();
  let [l,r] = [0,0];

  const LIMIT = 15;
  // const LIMIT = 1000000000;

  function getSum(to){
    return (to % 2 == 0?1:-1)*(Math.ceil(to/2));
  }

  for(var t = 0; t < n; t++){
    [l,r] = readInts();

    print(getSum(r) - getSum(l-1));
  }
}

// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

function resetRead(){
  lineCount = 0;
}

function checkMemoryUsage() {
  it(process.memoryUsage());
}

function readOne(separator=' ') {
  if(lineOpen && readingLine != null){
  // if(lineOpen){
    // it(readingLine);
    let splitPos = readingLine.search(separator)

    let ret = readingLine.slice(0, splitPos);
    if(splitPos == -1){
      // it('close');
      ret = readingLine;
      readingLine = '';
      lineOpen = false;
    }
    readingLine = readingLine.substr(splitPos + 1)
    // it(ret, readingLine, splitPos);
    return ret;
  } else {
    readingLine = readline();
    lineOpen = true;
    if(readingLine == null) return '';
    return readOne(separator);
  }
}

function readInts() {
  try {
    lineOpen = false;
    return readline()
      .split(" ")
      .map(x => parseInt(x));
  } catch (error) {
    console.error(error);
    return null;
  }
}

switch (SITE) {
  case TEST:
    var fs = require("fs");
    var path = require('path');
    // input = fs.createReadStream(path.resolve(__dirname, "input.txt"), {
    //   encoding: "utf8"
    // });
    input = fs.createReadStream(INPUTFILEPATH, {
      encoding: "utf8"
    });

    function inputListener(line) {
      console.log(line);
      if(line.startsWith('end')){
        console.log('end');
        closing();
      }
      if (!line) {
        closing();
      }
      lineCount++;
      inputText += line + "\r\n";
    }

    function readlines() {
      const readline = require("readline");
      const rl = readline.createInterface({
        input,
        output: process.stdout,
        terminal: false
      });
      rl.on("line", inputListener);
      rl.on('close', closing);
    }

    getlines = function* (inputText) {
      var lines = inputText.split(/\r?\n/);
      for (let line of lines) {
        yield line + newLine;
      }
    }

    readline = function () {
      return lines.next().value.trim();
    }

    readlines();

    break;

  case CODEFORCES_NODE:
    input = process.stdin;

    function inputListener(line) {
      if (!line) {
        closing();
      }
      lineCount++;
      inputText += line + "\r\n";
    }

    function readlines() {
      const readline = require("readline");
      const rl = readline.createInterface({
        input,
        output: process.stdout,
        terminal: false
      });
      rl.on("line", inputListener);
      rl.on('close', closing);
    }

    getlines = function* (inputText) {
      var lines = inputText.split(/\r?\n/);
      for (let line of lines) {
        yield line + newLine;
      }
    }

    readline = function () {
      return lines.next().value.trim();
    }

    readlines();

    break;
  case BEAKJOON:
    var fs = require('fs');
    if (DEBUG) {
      // input = fs.readFileSync('./input.txt').toString();
      inputText = fs.readFileSync(INPUTFILEPATH).toString();

    } else {
      inputText = fs.readFileSync('/dev/stdin').toString();
    }

    readline = function () {
      lineCount++;
      let line = lines[lineCount - 1];
      if (line)
        return lines[lineCount - 1].trim();
      else return null;
    }

    getlines = function (inputText) {
      lineCount = 0;
      return inputText.split(/\r?\n/);
    }

    // lines = getlines(input);
    closing();
    break;
  default:
    break;
}

function closing() {
  if(DEBUG){
    DisableLogging();
    const prepareClock = clock();
    lines = getlines(inputText);
    prepareSolve();
    const prepareClockElapsedTime = clock(prepareClock);
    EnableLogging();
    prepareTestData();
    solve();
    resetRead();
    console.warn('performance check');
    DisableLogging();
    clockStart = clock();
    // lines = getlines(inputText);
    solve();
    console.warn(`${clock(clockStart) + prepareClockElapsedTime} ms`);
    EnableLogging();
    process.exit();
  } else {
    lines = getlines(inputText);
    prepareSolve();
    solve();
    process.exit();
  }
}

var numbers = readline();

var numArr = [];
var splitArray = 0;
var sumPos = 0, sumNeg = 0;
var start = 0, end = 0;
for(var i = 0; i < numbers; i++){
   splitArray = readline().split(' ')
     numArr.push(splitArray);
}

for(var i = 0; i < numbers; i++){
     start = numArr[i][0], end = numArr[i][1];
      start = parseInt(start) ,end = parseInt(end)
      if(start%2===0 && end%2!==0){
      sumPos= Math.floor(start/2 - end/2)
      }
      if(start%2!==0 && end%2!==0){
       sumPos =  - Math.floor((start + end)/2)
      }
     if(start%2!==0 && end%2===0){
      sumPos = Math.floor(start/2 - end/2)
      }
    if(start%2===0 && end%2===0){
        sumPos =  Math.floor((start + end)/2)
      }

    if(end%2===0 && sumPos<0){sumPos = sumPos*(-1)}
    if(start === end){sumPos = end}
    if(sumPos%2!==0 && start === end){
    sumPos = sumPos*(-1)
    }
    print(sumPos)
}

const stdin = process.stdin;
stdin.setEncoding("utf8");
let n;
let data;
stdin.on("data", function(chunk) {
  if (!n) {
    const reg = /\d*/;
    n = chunk.match(reg)[0];
    data = chunk.slice(n.toString().length + 2);
  } else {
    data += chunk;
  }
});
stdin.on("end", function() {
  const inputLines = data.split("\n").slice(0, n);
  inputLines.forEach(inputLine => {
    const [l, r] = splitAndConvert(inputLine, 2);
    const result = solve(l, r);
    console.log(result);
    // console.log(l, r, result);
  });
});
function splitAndConvert(stringOfNumbers, numOfValid) {
  return stringOfNumbers
    .split(" ")
    .slice(0, numOfValid)
    .map(function(num) {
      return parseInt(num);
    });
}
function solve(l, r) {
  const delta = r - l;
  if (delta % 2 === 1) {
    const n = (delta + 1) / 2;
    const sign = r % 2 === 0 ? 1 : -1;
    return n * sign;
  } else {
    const n = delta / 2;
    const sign = r % 2 === 0 ? 1 : -1;
    const element = l * Math.pow(-1, l);
    return element + n * sign;
  }
}

solve();

function solve() {
    var q = Number(readline());
    var input, l, r, ans;
    for (;q--;) {
        input = readline().split(' ').map(Number);
        l = input[0];
        r = input[1];
        ans = 0;
        if (!(l & 1)) {
            ans += l;
            l++;
        }
        if (r & 1) {
            ans -= r;
            r--;
        }
        if (r >= l) {
            ans += (r - l + 1) / 2;
        }
        print(ans);
    }
}

function doIt() {
    var cnt = +readline();
    for(var i = 0; i < cnt; i++) {
        var query = readline().split(' ').map(v=>+v);
        var start = query[0];
        var finish = query[1];

        var step = start % 2 ? 1 : -1;
        var diff = (finish - start + 1);

        var res = Math.floor(diff / 2) * step;
        if(diff % 2) {
            var add = finish;
            if(add % 2) add *= -1;
            res += add;
        }

        print(res);
    }
}

doIt();

var numbers = readline();

var numArr = [];
var splitArray = 0;
var sumPos = 0, sumNeg = 0;
var start = 0, end = 0;
for(var i = 0; i < numbers; i++){
   splitArray = readline().split(' ')
     numArr.push(splitArray);
}

for(var i = 0; i < numbers; i++){
     start = numArr[i][0], end = numArr[i][1];
      start = parseInt(start) ,end = parseInt(end)
      if(start%2===0 && end%2!==0){
      sumPos= Math.floor(start/2 - end/2)
      }
      if(start%2!==0 && end%2!==0){
      sumPos= start/2 - end/2-1
      }
     if(start%2!==0 && end%2===0){
      sumPos = Math.floor(start/2 - end/2)
      }
    if(start%2===0 && end%2===0){
        sumPos =  Math.floor((start + end)/2)
      }

    if(end%2==0 && sumPos<0){sumPos = sumPos*(-1)}
    if(start === end){sumPos = end}
    if(sumPos%2!==0 && start === end){
    sumPos = sumPos*(-1)
    }
    print(sumPos)
}

var numbers = readline();

var numArr = [];
var splitArray = 0;
var sumPos = 0, sumNeg = 0;
var start = 0, end = 0;
for(var i = 0; i < numbers; i++){
   splitArray = readline().split(' ')
     numArr.push(splitArray);
}

for(var i = 0; i < numbers; i++){
     start = numArr[i][0], end = numArr[i][1];
      start = parseInt(start) ,end = parseInt(end)
      if(start*2<end && start*3!==end && end<10){
          sumPos = Math.floor(start/2 - end/2);
      }  else sumPos = start - end
      if(start*3!==end && end>10){
          sumPos = Math.ceil(end/2 - start/2);
      }

    if(start === end){sumPos = end}
    if(sumPos%2!==0 && start === end){
    sumPos = sumPos*(-1)
    }
    print(sumPos)
}

var numbers = readline();

var numArr = [];
var splitArray = 0;
var sumPos = 0, sumNeg = 0;
var start = 0, end = 0;
for(var i = 0; i < numbers; i++){
   splitArray = readline().split(' ')
     numArr.push(splitArray);
}

for(var i = 0; i < numbers; i++){
     start = numArr[i][0], end = numArr[i][1];
      start = parseInt(start) ,end = parseInt(end)
      if(start*2<end){ sumPos = start*4 - end*2}
    else sumPos = start - end
    if(start === end){sumPos = start}
    if(sumPos%2!==0){
    sumPos = -Math.abs(sumPos)
    }
    print(sumPos)
}

const stdin = process.stdin;
stdin.setEncoding("utf8");
let n;
let data;
stdin.on("data", function(chunk) {
  if (!n) {
    const reg = /\d*/;
    n = chunk.match(reg)[0];
    data = chunk.slice(n.toString().length + 1);
  } else {
    data += chunk;
  }
});
stdin.on("end", function() {
  const inputLines = data.split("\n").slice(0, n);
  inputLines.forEach(inputLine => {
    const [l, r] = splitAndConvert(inputLine, 2);
    const result = solve(l, r);
    console.log(result);
    // console.log(l, r, result);
  });
});
function splitAndConvert(stringOfNumbers, numOfValid) {
  return stringOfNumbers
    .split(" ")
    .slice(0, numOfValid)
    .map(function(num) {
      return parseInt(num);
    });
}
function solve(l, r) {
  const delta = r - l;
  if (delta % 2 === 1) {
    const n = (delta + 1) / 2;
    const sign = r % 2 === 0 ? 1 : -1;
    return n * sign;
  } else {
    const n = delta / 2;
    const sign = r % 2 === 0 ? 1 : -1;
    const element = l * Math.pow(-1, l);
    return element + n * sign;
  }
}


Array.prototype.sum = function () {
	var l = this.length,
		ret = 0;

	for (var i = 0; i < l; i++) {
		ret += this[i];
	}

	return ret;
}

;(function () {

	var n = +readline();

	for (var i = 0, k = []; i < n; i++) k.push(readline().split(' ').map(Number));
	for (var i = 0, s = []; i < n; i++) s.push(k[i].sum());
	for (var i = 0, c = []; i < n; i++) c.push(k.map(function (e) { return e[i]; }).sum());

	print((function () {
		for (var i = 0, ret = 0; i < n; i++)
			for (var j = 0; j < n; j++)
				ret += c[j] > s[i];
		return ret;
	})());

}).call(this);

print(function(n) {

	var i, j, a = [],
		ans = 0,
		x = new Int32Array(n),
		y = new Int32Array(n);

	for (i = 0; i < n; i++)
		a.push(readline().split(' ').map(Number));

	for (i = 0; i < n; i++)
		for (j = 0; j < n; j++) {
			x[i] += a[i][j];
			y[j] += a[i][j];
		}

	for (i = 0; i < n; i++)
		for (j = 0; j < n; j++)
			if (x[i] < y[j]) ans++;

	return ans;

}(+readline()));

var inp = readline().split(' ');
var n = Number(inp[0]);
var A = [];
var R = [];
var C = [];

for(var i=1; i<=n; i++)
R[i]=C[i]=0;

for(var i=1; i<=n; i++)
{
inp = readline().split(' ');
A[i]=[];
for(var j=1; j<=n; j++)
{
	A[i][j]=Number(inp[j-1]);
	R[i]+=A[i][j];
	C[j]+=A[i][j];
}
}

var ats = 0;

for(var i=1; i<=n; i++)
for(var j=1; j<=n; j++)
if(C[j] > R[i])ats++;

print(ats);

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

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

  arr.push(d.split(' ').map(Number));

  c++;
});

rl.on('close', () => {
  let ans = 0;

  for (let i = 0; i < arr.length; i++) {
    let sumCol = 0;
    let sumRow = 0;

    for (let j = 0; j < arr[i].length; j++) {
      sumCol += arr[i][j];
    }

    let z = 0;
    while (z < arr.length) {
      let sumRow = 0;
      for (let k = 0; k < arr.length; k++) {
        sumRow += arr[k][z];
      }

      if (sumRow > sumCol) {
        ans++;
      }

      z++;
    }
  }

  console.log(ans);
});

print(function(n) {

	var i, j, a = [],
		ans = 0,
		x = new Int32Array(n),
		y = new Int32Array(n);

	for (i = 0; i < n; i++)
		a.push(readline().split(' ').map(Number));

	for (i = 0; i < n; i++)
		for (j = 0; j < n; j++) {
			x[i] += a[i][j];
			y[j] += a[i][j];
		}

	for (i = 0; i < n; i++)
		for (j = 0; j < n; j++)
			if (x[i] > y[j]) ans++;

	return ans;

}(+readline()));