#SDNU1726. Triangle Squera
Triangle Squera
题目描述
There are three points , , in the plane rectangular coordinate system. Define the size of triangle as the number of squares that belong to it.
For integers , one square is defined by four points , , , . We consider a square to belong to a triangle if half or more of it is inside the triangle.
For example, when , the square of triangle will be . The image below shows which squares are counted in the triangle.
输入格式
The first line contains one integer () —— the number of testcases.
The follow lines, for each line contain two integers and .
输出格式
Print an integer: the size of triangle .
Sample Iutput 1
3
6 8
5 5
1 999999
Sample Iutput 1
24
15
500000