'use strict'

const q = parseInt(readline());

const fn = (n, r, x) => {
    let i = 0;
    while (x[i] - i * r > 0) i++;
    return i;
}

for(let i = 0; i < q; i++) {
    const nr = readline().split(' ');
    const x = [ ...(new Set(readline().split(' ')))].sort((A, B) => B - A);
    print(fn(nr[0], nr[1], x));
}

function merge(leftArr, rightArr) {
  var sortedArr = [];
  while (leftArr.length && rightArr.length) {
    if (leftArr[0] <= rightArr[0]) {
      sortedArr.push(leftArr[0]);
      leftArr = leftArr.slice(1)
   } else {
      sortedArr.push(rightArr[0]);
      rightArr = rightArr.slice(1)
     }
   }
  while (leftArr.length)
    sortedArr.push(leftArr.shift());
  while (rightArr.length)
    sortedArr.push(rightArr.shift());
  return sortedArr;
}

function mergeSort(arr) {
  if (arr.length < 2) {
    return arr; }
  else {
    var midpoint = parseInt(arr.length / 2);
    var leftArr   = arr.slice(0, midpoint);
    var rightArr  = arr.slice(midpoint, arr.length);
    return merge(mergeSort(leftArr), mergeSort(rightArr));
  }
}

var queriesCount = parseInt(readline());

var queries = [];

for (var i = 0; i < queriesCount; i++) {
  queries.push([]);
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
}

// var queries = [[[4, 2], [1, 6, 6, 6, 6, 2]], [[3, 2], [1, 3, 5]]];
// var queriesCount = 2

function main(positions, queryParams) {
  var prevNum = undefined;
  positions = positions.sort(function(a, b) {
    return (a < b) ? -1 : 1;
  });
  var numOfShots = 0;
  var r = queryParams[1];
  var accum = 0;
  for (var j = positions.length - 1; j > -1 ; j--) {
    if (positions[j] === prevNum) {
      continue;
    }
    else if (positions[j] - accum <= 0) {
      return write('' + numOfShots + '\n');
    }
    else {
      prevNum = positions[j];
      accum += r;
      numOfShots++;
    }
  }
  return write('' + numOfShots + '\n');
}

for (var i = 0; i < queriesCount; i++) {
  var positions = queries[i][1]
  var queryParams = queries[i][0]
  main(positions, queryParams);
}

const readline = require("readline").createInterface(process.stdin, process.stdout);

const solution = (function* (){
  let result = '',
      lines = yield;
  while (lines--){
    let [n, r] = (yield).split(' '),
        coordinates = [...(new Set((yield).split(' ').sort((a,b) => a - b)))],
        i = 0;

    while ((coordinates.pop() - r * i) > 0)
      i++;

    result += i + '\n';
  }
  console.log(result);
  process.exit(0);
})()
solution.next();

readline.on("line", line => solution.next(line));

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL);

    function foo (count, distance, positions) {
        const hashMap = {};

        positions.forEach((pos) => {
            hashMap[pos] = true;
        });

        let kills = 0;
        let doKill = true;
        let keys = Object.keys(hashMap);

        while(doKill) {
            kills++;
            let max = keys[keys.length - kills];
            delete hashMap[max];
            max = keys[keys.length - kills - 1];
            doKill = max - kills * distance > 0;
        }
        return kills;
    }

    let testCount = 1;
    let answer = '';
    while(testCount <= +lines[0]) {
        let positions = lines[testCount * 2].split(" ").map(Number);
        let row1 = lines[testCount * 2 - 1].split(" ").map(Number);
        let result = foo(row1[0], row1[1], positions);
        answer += result +"\n";
        testCount++;
    }
    console.log(answer);

})

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL);

    function foo (count, distance, positions) {

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

        let kills = 0;
        function doKill() {
            kills++;
            positions.pop();
            positions.forEach((pos) => pos - distance);
            positions.filter((pos) => pos > 0);
            if (positions.length) doKill();
        }
        doKill();
        return kills;
    }

    let testCount = 1;
    let answer = '';
    while(testCount <= +lines[0]) {
        let row1 = lines[testCount * 2].split(" ").map(Number);
        let positions = lines[testCount * 2 - 1].split(" ").map(Number);

        //console.log(data);
        //console.log(n);
        let result = foo(row1[0], row1[1], positions);
        answer += result +"\n";
        testCount++;
    }
    console.log(answer);
})

'use strict'

const q = parseInt(readline());

const fn = (n, r, x) => {
    let i = 0;
    while (x[i] - i * r > 0) i++;
    return i;
}

for(let i = 0; i < q; i++) {
    const nr = readline().split(' ');
    const x = readline().split(' ').sort((A, B) => B - A);
    print(fn(nr[0], nr[1], x));
}

function merge(leftArr, rightArr) {
  var sortedArr = [];
  while (leftArr.length && rightArr.length) {
    if (leftArr[0] <= rightArr[0]) {
      sortedArr.push(leftArr[0]);
      leftArr = leftArr.slice(1)
   } else {
      sortedArr.push(rightArr[0]);
      rightArr = rightArr.slice(1)
     }
   }
  while (leftArr.length)
    sortedArr.push(leftArr.shift());
  while (rightArr.length)
    sortedArr.push(rightArr.shift());
  return sortedArr;
}

function mergeSort(arr) {
  if (arr.length < 2) {
    return arr; }
  else {
    var midpoint = parseInt(arr.length / 2);
    var leftArr   = arr.slice(0, midpoint);
    var rightArr  = arr.slice(midpoint, arr.length);
    return merge(mergeSort(leftArr), mergeSort(rightArr));
  }
}

var queriesCount = parseInt(readline());

var queries = [];

for (var i = 0; i < queriesCount; i++) {
  queries.push([]);
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
}

// var queries = [[[4, 1], [5, 2, 3, 5, 6]]];
// var queriesCount = 1

function main(positions, queryParams) {
  var prevNum = undefined;
  mergeSort(positions);
  var numOfShots = 0;
  var r = queryParams[1];
  var accum = 0;
  for (var j = positions.length - 1; j > -1 ; j--) {
    if (positions[j] === prevNum) {
      accum -= r;
      continue;
    }
    else if (positions[j] - accum <= 0) {
      return write('' + numOfShots);
    }
    else {
      prevNum = positions[j];
      accum += r;
      numOfShots++;
    }
  }
  return write('' + numOfShots)
}

for (var i = 0; i < queriesCount; i++) {
  var positions = queries[i][1]
  var queryParams = queries[i][0]
  main(positions, queryParams);
}

function merge(leftArr, rightArr) {
  var sortedArr = [];
  while (leftArr.length && rightArr.length) {
    if (leftArr[0] <= rightArr[0]) {
      sortedArr.push(leftArr[0]);
      leftArr = leftArr.slice(1)
   } else {
      sortedArr.push(rightArr[0]);
      rightArr = rightArr.slice(1)
     }
   }
  while (leftArr.length)
    sortedArr.push(leftArr.shift());
  while (rightArr.length)
    sortedArr.push(rightArr.shift());
  return sortedArr;
}

function mergeSort(arr) {
  if (arr.length < 2) {
    return arr; }
  else {
    var midpoint = parseInt(arr.length / 2);
    var leftArr   = arr.slice(0, midpoint);
    var rightArr  = arr.slice(midpoint, arr.length);
    return merge(mergeSort(leftArr), mergeSort(rightArr));
  }
}

var queriesCount = parseInt(readline());

var queries = [];

for (var i = 0; i < queriesCount; i++) {
  queries.push([]);
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
}

// var queries = [[[4, 1], [1, 6, 6, 6, 6]], [[3, 2], [1, 3, 5]]];
// var queriesCount = 2

function main(positions, queryParams) {
  var prevNum = undefined;
  mergeSort(positions);
  var numOfShots = 0;
  var r = queryParams[1];
  var accum = 0;
  for (var j = positions.length - 1; j > -1 ; j--) {
    if (positions[j] === prevNum) {
      continue;
    }
    else if (positions[j] - accum <= 0) {
      return write('' + numOfShots + '\n');
    }
    else {
      prevNum = positions[j];
      accum += r;
      numOfShots++;
    }
  }
  return write('' + numOfShots + '\n');
}

for (var i = 0; i < queriesCount; i++) {
  var positions = queries[i][1]
  var queryParams = queries[i][0]
  main(positions, queryParams);
}

function merge(leftArr, rightArr) {
  var sortedArr = [];
  while (leftArr.length && rightArr.length) {
    if (leftArr[0] <= rightArr[0]) {
      sortedArr.push(leftArr[0]);
      leftArr = leftArr.slice(1)
   } else {
      sortedArr.push(rightArr[0]);
      rightArr = rightArr.slice(1)
     }
   }
  while (leftArr.length)
    sortedArr.push(leftArr.shift());
  while (rightArr.length)
    sortedArr.push(rightArr.shift());
  return sortedArr;
}

function mergeSort(arr) {
  if (arr.length < 2) {
    return arr; }
  else {
    var midpoint = parseInt(arr.length / 2);
    var leftArr   = arr.slice(0, midpoint);
    var rightArr  = arr.slice(midpoint, arr.length);
    return merge(mergeSort(leftArr), mergeSort(rightArr));
  }
}

var queriesCount = parseInt(readline());

var queries = [];

for (var i = 0; i < queriesCount; i++) {
  queries.push([]);
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
}

// var queries = [[[4, 1], [5, 2, 3, 5, 6]], [[3, 2], [1, 3, 5]]];
// var queriesCount = 2

function main(positions, queryParams) {
  var prevNum = undefined;
  mergeSort(positions);
  var numOfShots = 0;
  var r = queryParams[1];
  var accum = 0;
  for (var j = positions.length - 1; j > -1 ; j--) {
    if (positions[j] === prevNum) {
      accum -= r;
      continue;
    }
    else if (positions[j] - accum <= 0) {
      return write('' + numOfShots + '\n');
    }
    else {
      prevNum = positions[j];
      accum += r;
      numOfShots++;
    }
  }
  return write('' + numOfShots + '\n')
}

for (var i = 0; i < queriesCount; i++) {
  var positions = queries[i][1]
  var queryParams = queries[i][0]
  main(positions, queryParams);
}

function merge(leftArr, rightArr) {
  var sortedArr = [];
  while (leftArr.length && rightArr.length) {
    if (leftArr[0] <= rightArr[0]) {
      sortedArr.push(leftArr[0]);
      leftArr = leftArr.slice(1)
   } else {
      sortedArr.push(rightArr[0]);
      rightArr = rightArr.slice(1)
     }
   }
  while (leftArr.length)
    sortedArr.push(leftArr.shift());
  while (rightArr.length)
    sortedArr.push(rightArr.shift());
  return sortedArr;
}

function mergeSort(arr) {
  if (arr.length < 2) {
    return arr; }
  else {
    var midpoint = parseInt(arr.length / 2);
    var leftArr   = arr.slice(0, midpoint);
    var rightArr  = arr.slice(midpoint, arr.length);
    return merge(mergeSort(leftArr), mergeSort(rightArr));
  }
}

var queriesCount = parseInt(readline());

var queries = [];

for (var i = 0; i < queriesCount; i++) {
  queries.push([]);
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
  queries[i].push(readline().split(' ').map(function(num) {
    return parseInt(num);
  }))
}

// var queries = [[[4, 1], [5, 2, 3, 5, 6]], [[3, 2], [1, 3, 5]]];
// var queriesCount = 2

function main(positions, queryParams) {
  var prevNum = undefined;
  mergeSort(positions);
  var numOfShots = 0;
  var r = queryParams[1];
  var accum = 0;
  for (var j = positions.length - 1; j > -1 ; j--) {
    if (positions[j] === prevNum) {
      accum -= r;
      continue;
    }
    else if (positions[j] - accum <= 0) {
      return write(numOfShots);
    }
    else {
      prevNum = positions[j];
      accum += r;
      numOfShots++;
    }
  }
  return write(numOfShots)
}

for (var i = 0; i < queriesCount; i++) {
  var positions = queries[i][1]
  var queryParams = queries[i][0]
  main(positions, queryParams);
}


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

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

let count = -1
let inputArr = []

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

function solve(num) {
    console.log((-num + 1n).toString() + ' ' + num.toString())
}

function main() {
    for (let i = 0; i < inputArr.length; i++) solve(inputArr[i])
}

// dist/FinalCode/Common/InputOutputClass.js
var Input = function() {
  function Input2(inputData) {
    var _this = this;
    this.SettleStream = function() {
      var re = /\s+/;
      _this.inputWords = _this.inputStream.split(re);
      _this.inputWordsLength = _this.inputWords.length;
    };
    this.getLength = function() {
      return _this.inputWordsLength;
    };
    this.getEveryWord = function() {
      return _this.inputWords;
    };
    this.getNextWord = function() {
      _this.inputWordsCount++;
      if (_this.inputWordsLength < _this.inputWordsCount) {
        return "";
      }
      return _this.inputWords[_this.inputWordsCount - 1];
    };
    this.getNextString = function() {
      return _this.getNextWord();
    };
    this.getNextBigInt = function() {
      return BigInt(_this.getNextWord());
    };
    this.getNextNumber = function() {
      return Number(_this.getNextWord());
    };
    this.getNextInt = function() {
      return parseInt(_this.getNextWord(), 10);
    };
    this.getNextFloat = function() {
      return parseFloat(_this.getNextWord());
    };
    this.inputWordsCount = 0;
    this.inputStream = inputData;
  }
  Input2.prototype.SetStream = function(chunk) {
    this.inputStream += chunk;
  };
  return Input2;
}();
var InputOutputClass_default = Input;
var writeLine = function(outputElement) {
  var _internalWrite = function(_internalOutputElement) {
    process.stdout.write(_internalOutputElement);
  };
  _internalWrite(String(outputElement) + "\n");
};

// dist/main.js
var rw = new InputOutputClass_default("");
process.stdin.resume();
process.stdin.setEncoding("utf-8");
process.stdin.on("data", function(chunk) {
  rw.SetStream(chunk);
});
process.stdin.on("end", function() {
  rw.SettleStream();
  mainFunc();
});
var mainFunc = function() {
  testCases();
};
var testCases = function() {
  var test = rw.getNextInt();
  for (var i = 0; i < test; i++) {
    solveCase();
  }
};
var solveCase = function() {
  var num = rw.getNextString();
  writeLine(-BigInt(num) + BigInt(1) + " " + num);
};

var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};

// dist/FinalCode/Common/InputOutputClass.js
var require_InputOutputClass = __commonJS({
  "dist/FinalCode/Common/InputOutputClass.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.IOThings = exports2.writeLine = void 0;
    var Input = class {
      constructor(inputData) {
        this.SettleStream = () => {
          const re = /\s+/;
          this.inputWords = this.inputStream.split(re);
          this.inputWordsLength = this.inputWords.length;
        };
        this.getLength = () => {
          return this.inputWordsLength;
        };
        this.getEveryWord = () => {
          return this.inputWords;
        };
        this.getNextWord = () => {
          this.inputWordsCount++;
          if (this.inputWordsLength < this.inputWordsCount) {
            return "";
          }
          return this.inputWords[this.inputWordsCount - 1];
        };
        this.getNextString = () => {
          return this.getNextWord();
        };
        this.getNextBigInt = () => {
          return BigInt(this.getNextWord());
        };
        this.getNextNumber = () => {
          return Number(this.getNextWord());
        };
        this.getNextInt = () => {
          return parseInt(this.getNextWord(), 10);
        };
        this.getNextFloat = () => {
          return parseFloat(this.getNextWord());
        };
        this.inputWordsCount = 0;
        this.inputStream = inputData;
      }
      SetStream(chunk) {
        this.inputStream += chunk;
      }
    };
    exports2.default = Input;
    var writeLine = (outputElement) => {
      const _internalWrite = (_internalOutputElement) => {
        process.stdout.write(_internalOutputElement);
      };
      _internalWrite(String(outputElement) + "\n");
    };
    exports2.writeLine = writeLine;
    var IOThings = () => {
      const rw2 = new Input("");
      process.stdin.resume();
      process.stdin.setEncoding("utf-8");
      process.stdin.on("data", (chunk) => {
        rw2.SetStream(chunk);
      });
      process.stdin.on("end", () => {
        rw2.SettleStream();
      });
      return rw2;
    };
    exports2.IOThings = IOThings;
  }
});

// dist/main.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var InputOutputClass_1 = require_InputOutputClass();
var rw = new InputOutputClass_1.default("");
process.stdin.resume();
process.stdin.setEncoding("utf-8");
process.stdin.on("data", (chunk) => {
  rw.SetStream(chunk);
});
process.stdin.on("end", () => {
  rw.SettleStream();
  mainFunc();
});
var mainFunc = () => {
  testCases();
};
var testCases = () => {
  const test = rw.getNextInt();
  for (let i = 0; i < test; i++) {
    solveCase();
  }
};
var solveCase = () => {
  const num = rw.getNextString();
  (0, InputOutputClass_1.writeLine)(`${-BigInt(num) + BigInt(1)} ${num}`);
};

'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++];
}
/**
7
1
2
3
6
100
25
3000000000000

**/

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

    return gcd(b, a % b);
};

function lcm(a, b) {
    return (a / gcd(a, b) * b);
}

function main() {
    let n = Number(readline());

    for(let r=0;r<n;r++) {
        solve();
    }

}

function solve() {
    let n = BigInt(readline());

    let a = n;
    let b = -(n-BigInt(1));

    console.log(`${b} ${a}`);

}

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

function* nextLine() {
	let lines = data.trim().split(/\n/g);
	for(let l of lines){
		yield l.trim();
	}
}

let nl = nextLine();

nl.elem = function(funParse) {
		return funParse(this.next().value);
	};

nl.array = function(funParse) {
		return this.next().value.split(/\s/g).map(funParse||(x => x));
	};

nl.num = function() {
		return nl.elem(Number);
	};

nl.nums = function() {
		return nl.array(Number);
	};

nl.line = function() {
		return this.next().value;
	};

const sol = () => {
	//your code this
	let t = nl.num();
	let ans = [];
	for(let i = 0 ;i < t; i++){
		let n = nl.elem(BigInt);
		if (n > 0) {
			ans.push([-n + 1n, n]);
		} else {
			ans.push([n, -n - 1n]);
		}
	}
	console.log(ans.map(e => e.join(' ')).join('\n'));
};

process.stdin.on('end', sol);

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    for (let i = 0; i < t; i++) {
        const n = BigInt(lines[l++])
        console.log(solve(n).join(' '))
    }
// })()
})

function solve(n) {
    if (isOdd(n)) {
        return [(n - 1n) / 2n, (n + 1n) / 2n]
    } else {
        // const count = 2n * n
        return [-n + 1n, n]
        // let k = n / 2n
        // while (!isOdd(k)) k /= 2n

        // const count = k
        // const sum = 2n * n / count
        // // 2 * l + count - 1 = sum
        // const l = sum + 1n - count
        // return [l, l + count - 1n]
    }
}
function isOdd(n) {
    return n / 2n === (n - 1n) / 2n
}

var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};

// dist/FinalCode/Common/InputOutputClass.js
var require_InputOutputClass = __commonJS({
  "dist/FinalCode/Common/InputOutputClass.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.IOThings = exports2.writeLine = void 0;
    var Input = class {
      constructor(inputData) {
        this.SettleStream = () => {
          const re = /\s+/;
          this.inputWords = this.inputStream.split(re);
          this.inputWordsLength = this.inputWords.length;
        };
        this.getLength = () => {
          return this.inputWordsLength;
        };
        this.getEveryWord = () => {
          return this.inputWords;
        };
        this.getNextWord = () => {
          this.inputWordsCount++;
          if (this.inputWordsLength < this.inputWordsCount) {
            return "";
          }
          return this.inputWords[this.inputWordsCount - 1];
        };
        this.getNextString = () => {
          return this.getNextWord();
        };
        this.getNextBigInt = () => {
          return BigInt(this.getNextWord());
        };
        this.getNextNumber = () => {
          return Number(this.getNextWord());
        };
        this.getNextInt = () => {
          return parseInt(this.getNextWord(), 10);
        };
        this.getNextFloat = () => {
          return parseFloat(this.getNextWord());
        };
        this.inputWordsCount = 0;
        this.inputStream = inputData;
      }
      SetStream(chunk) {
        this.inputStream += chunk;
      }
    };
    exports2.default = Input;
    var writeLine = (outputElement) => {
      const _internalWrite = (_internalOutputElement) => {
        process.stdout.write(_internalOutputElement);
      };
      _internalWrite(String(outputElement) + "\n");
    };
    exports2.writeLine = writeLine;
    var IOThings = () => {
      const rw2 = new Input("");
      process.stdin.resume();
      process.stdin.setEncoding("utf-8");
      process.stdin.on("data", (chunk) => {
        rw2.SetStream(chunk);
      });
      process.stdin.on("end", () => {
        rw2.SettleStream();
      });
      return rw2;
    };
    exports2.IOThings = IOThings;
  }
});

// dist/main.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var InputOutputClass_1 = require_InputOutputClass();
var rw = new InputOutputClass_1.default("");
process.stdin.resume();
process.stdin.setEncoding("utf-8");
process.stdin.on("data", (chunk) => {
  rw.SetStream(chunk);
});
process.stdin.on("end", () => {
  rw.SettleStream();
  mainFunc();
});
var mainFunc = () => {
  testCases();
};
var testCases = () => {
  const test = rw.getNextInt();
  for (let i = 0; i < test; i++) {
    solveCase();
  }
};
var solveCase = () => {
  const num = rw.getNextString();
  (0, InputOutputClass_1.writeLine)(`-${BigInt(num) - BigInt(1)} ${num}`);
};

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

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

let count = -1
let inputArr = []

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

function solve(num) {
    const a1 = num / 2n
    const a2 = num % 2n === 0n ? num / 2n : num / 2n + 1n
    console.log(a1.toString() + ' ' + a2.toString())
}

function main() {
    for (let i = 0; i < inputArr.length; i++) solve(inputArr[i])
}

'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++];
}
/**
7
1
2
3
6
100
25
3000000000000

**/

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

    return gcd(b, a % b);
};

function lcm(a, b) {
    return (a / gcd(a, b) * b);
}

function main() {
    let n = Number(readline());

    for(let r=0;r<n;r++) {
        solve();
    }

}

function solve() {
    let n = Number(readline());
    if(n === 1) {
        console.log("0 1");
        return;
    }

    let a = n;
    let b = -(n-1);

    console.log(`${b} ${a}`);

}


'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() {
    var x = Number(readline())
    Array(Number(x)).fill(1).map((t, i) => {
        var n = parseInt(readline())
        var sqrt = Math.floor(Math.sqrt(n))

        // for (var i = 1; i <= 100; i++) {
        //     var ss = Math.floor(Math.sqrt(2 * i + 1))
            //
            // if (ss * ss === 2 * i + 1 && ss * ss + i * i === (i + 1) * (i + 1)) {
            //     console.log(ss, i, i + 1)
            //     count++
            // }
        // }

        var i = sqrt
        var b = Math.ceil(i-1/2)

        while (b<=n){
            i++
            b = Math.ceil((i*i-1)/2)+1
        }
        console.log(Math.floor(i /2)-1)

        // for (var i = 3; i*i <= n*4; i=i+2) {
        //     var b = Math.floor((i*i-1)/2)
// console.log(i*i, b,b+1)
//         if(b*2+1===i*i && b*2+1 <= n && b>0) {
//             console.log(i,b,b+1 )
//             count++
//         }
//         }
        // var mid = Math.fl/oor(n/2)
        // var res = Math.floor((k-1) / mid)

    })

}

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

    return gcd(b, a % b);
}

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

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

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

		cmx = n;
		bmx = cmx - 1;
		amx = Math.floor(Math.sqrt(2*bmx + 1));

		ans = Math.ceil(amx/2) - 1;

		console.log(ans);
	}
}


const vIn = [];
let itIn = 0;
const getNext = () => vIn[itIn++];
const getInt = () => parseInt(getNext(), 10);
const forEachN = (n, cb, flagInt = false) => {
  const nextItIn = itIn + n;
  const fn = flagInt ? getInt : getNext;
  while (itIn !== nextItIn) cb(fn());
};

class SolveProblemClass {
  constructor() {
  }

  solveAll() {
    const n = getInt();
    const a = getNext();
    const b = getNext();
    let aOnes = 0;
    for (let i = 0; i < n ; i++) if (a[i] === '1') aOnes++;
    const aCero = n - aOnes;
    let old = [0, 0];
    let total = 0;
    for (let i = 0; i < n ; i++) {
      if (b[i] === '0') {
        if (a[i] === '1') {
          total += aCero - old[0];
        } else {
          total += aOnes - old[1];
        }
        old[a[i]]++;
      }
    }
    console.log(total);
  }
}

const processData = (input) => {
  input.split('\n').forEach(line => {
    // vIn.push(line);
    line.split(' ').forEach(item => { vIn.push(item); });
  });
};

const solveP = new SolveProblemClass();
process.stdin.resume();
process.stdin.setEncoding("ascii");
let _input = "";
process.stdin.on("data", (input) => {
  _input += input;
});
process.stdin.on("end", () => {
  processData(_input);
  solveP.solveAll();
});

function main() {
  const is = new Scanner();
  const n = is.nextInt();
  const a = is.nextLine();
  const b = is.nextLine();
  let answer = 0, aux = 0;
  let zerosA = 0, onesA = 0;
  let zerosB = 0, onesB = 0;
  for (let i = 0; i < n; i += 1) {
    if (a[i] === '0' && b[i] === '0' || a[i] === '1' && b[i] === '0') {
      if (a[i] === '0')
        zerosB++;
      if (a[i] === '1')
        onesB++;
    }
    else {
      if (a[i] === '0')
        zerosA++;
      if (a[i] === '1')
        onesA++;
    }
      answer += 1;
  }
  answer = zerosB * onesB;
  answer += onesA * zerosB;
  answer += onesB * zerosA;

  console.log(answer);
}

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

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

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

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

  nextArray(fn) {
    const array = this.nextLine().split(' ');
    return fn === String ? array : array.map(fn);
  }

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

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

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

function magic(n) { return n <= 1 ? 0 : magic(n - 1) + n - 1 }

let a, b, numWays, numLines = 0
rl.on('line', (line) => {
    ++numLines
    if (numLines == 2) a = line.split('').map(x => parseInt(x))
    if (numLines == 3) b = line.split('').map(x => parseInt(x))
}).on('close', () => {
    let t = [[0, 0], [0, 0]]
    a.forEach((bit, idx) => {
        t[bit][b[idx]]++
    })
    process.stdout.write(`${t[0][0] * t[1][0] + t[1][0] * t[0][1] + t[0][0] * t[1][1]}`)
})

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

let a, b, numLines = 0
rl.on('line', (line) => {
    ++numLines
    if (numLines == 2) a = line.split('').map(x => parseInt(x))
    if (numLines == 3) b = line.split('').map(x => parseInt(x))
}).on('close', () => {
    let t = [[0, 0], [0, 0]]
    a.forEach((bit, idx) => t[bit][b[idx]]++)
    process.stdout.write(`${t[0][0] * t[1][0] + t[1][0] * t[0][1] + t[0][0] * t[1][1]}`)
})

function main() {
  const is = new Scanner();
  const n = is.nextInt();
  const a = is.nextLine();
  const b = is.nextLine();
  let answer = 0, aux = 0;
  for (let i = 0; i < n; i += 1) {
    if (a[i] === '0' && b[i] === '0' || a[i] === '1' && b[i] === '0')
      aux += 1;
    else
      answer += 1;
  }
  answer += (aux * (aux - 1)) / 2;
  console.log(answer);
}

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

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

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

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

  nextArray(fn) {
    const array = this.nextLine().split(' ');
    return fn === String ? array : array.map(fn);
  }

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

function main() {
  const is = new Scanner();
  const n = is.nextInt();
  const a = is.nextLine();
  const b = is.nextLine();
  let answer = 0, aux = 0;
  for (let i = 0; i < n; i += 1) {
    if (a[i] === '0' && b[i] === '0' || a[i] === '1' && b[i] === '0')
      aux += 1;
    else
      answer += 1;
  }
  if (aux === 0)
    answer = 0;
  else
    answer += (aux * (aux - 1)) / 2;

  console.log(answer);
}

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

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

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

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

  nextArray(fn) {
    const array = this.nextLine().split(' ');
    return fn === String ? array : array.map(fn);
  }

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

function main() {
  const is = new Scanner();
  const n = is.nextInt();
  const a = is.nextLine();
  const b = is.nextLine();
  let answer = 0, aux = 0;
  for (let i = 0; i < n; i += 1) {
    if (a[i] === '0' && b[i] === '0' || a[i] === '1' && b[i] === '0')
      aux += 1;
    else
      answer += 1;
  }
  if (aux === 0)
    answer = 0;
  else
    answer += Math.max(1, (aux * (aux - 1)) / 2);

  console.log(answer);
}

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

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

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

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

  nextArray(fn) {
    const array = this.nextLine().split(' ');
    return fn === String ? array : array.map(fn);
  }

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

function main() {
  const is = new Scanner();
  const n = is.nextInt();
  const a = is.nextLine();
  const b = is.nextLine();
  let answer = 0, aux = 0;
  for (let i = 0; i < n; i += 1) {
    if (a[i] === '0' && b[i] === '0' || a[i] === '1' && b[i] === '0')
      aux += 1;
    else
      answer += 1;
  }
  if (aux === 0)
    answer = 0;
  else
    answer += Math.round((aux * (aux - 1)) / 2);

  console.log(answer);
}

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

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

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

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

  nextArray(fn) {
    const array = this.nextLine().split(' ');
    return fn === String ? array : array.map(fn);
  }

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

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

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

function magic(n) { return n <= 1 ? 0 : magic(n - 1) + n - 1 }

let a, b, numWays, numLines = 0
rl.on('line', (line) => {
    ++numLines
    if (numLines == 2) a = line.split('')
    if (numLines == 3) b = line.split('')
}).on('close', () => {
    let sum = 0, ones = a.filter(x => x == 1).length, zeros = a.length - ones
    a.forEach((bit, idx) => {
        if (b[idx] == 0) {
            if (bit == 0) {
                sum += ones
            } else {
                sum += zeros
            }
        }
    })
    process.stdout.write(`${sum - b.filter(x => x == 0).length + 1}`)
})


(function() {
var INPUT = ``;
var OUTPUT = ``;

var main = function() {"use strict";
    // TODO
    var q = rdN();
    var foo = function(arr, k) {
        var sum = 0;
        for(var i = 0; i < k; ++i) {
            sum += arr[i];
        }
        var max = sum;
        for (var i = 0, j = k; j < arr.length; ++i, ++j) {
            //pr('sum=', sum, 'i=', arr[i], 'j=', arr[j])
            sum -= arr[i];
            sum += arr[j];
            if (max < sum) {
                max = sum;
            }

        }
        //pr()
        return k - max;
    };
    while (q --> 0) {
        var input = rdArN();
        var n = input[0];
        var k = input[1];
        var s = rdS();
        var R = [];
        var G = [];
        var B = [];
        var rgb = ['R', 'G', 'B'];
        for (var i = 0; i < n; ++i) {
            R.push(+(s[i] === rgb[(i+0)%3]));
            G.push(+(s[i] === rgb[(i+1)%3]));
            B.push(+(s[i] === rgb[(i+2)%3]));
        }
        //prAr(R);
        //prAr(G);
        //prAr(B);

        var fooR = foo(R, k);
        var fooG = foo(G, k);
        var fooB = foo(B, k);

        //prAr([fooR,fooG,fooB]);
        pr(Math.min(...[fooR,fooG,fooB]));
    }
};

if(INPUT){INPUT=INPUT.split('\n').reverse();
readline=()=>INPUT.pop();
write=(...s)=>{OUTPUT+=[...s].join(' ')};
print=(...s)=>{write(...s);OUTPUT+='\n'};}
const rdS=readline;
const rdN=()=>+rdS();
const rdArS=()=>rdS().split(' ');
const rdArN=()=>rdArS().map(v=>+v);
const wr=write;
const pr=print;
const prAr=(a)=>pr(...a);
const prOb=(o)=>pr(JSON.stringify(o,null,4));
const cmpLt=(a,b)=>a-b;
const cmpGt=(a,b)=>b-a;
const crAr=function(length,...fillArgs){return new Array(length).fill(...fillArgs);};
const getPrimes=function(n){var sieve=crAr(n+1,true);for(var i=2,j=4;j<sieve.length;j=Math.pow(++i,2)){if(sieve[j]){for(;j<sieve.length;j+=i){sieve[j]=false;}}}var primes=[];for(i=2;i<sieve.length;++i){if(sieve[i]){primes.push(i);}}return primes;};
const defineProperty=(o,pN,v)=>Object.defineProperty(o,pN,{configurable:true,enumerable:false,value:v});
defineProperty(Array.prototype,'sortLt',function(){return this.sort(cmpLt);});
defineProperty(Array.prototype,'sortGt',function(){return this.sort(cmpGt);});
defineProperty(Set.prototype,'union',function(s){return new Set([...this,...s]);});
defineProperty(Set.prototype,'intersection',function(s){return new Set([...this].filter((v)=>s.has(v)));});
defineProperty(Set.prototype,'difference',function(s){return new Set([...this].filter((v)=>!s.has(v)));});

main();
return OUTPUT;
})();