Suppose that $\left(a_{1}, b_{1}\right),\left(a_{2}, b_{2}\right), \ldots,\left(a_{100}, b_{100}\right)$ are distinct ordered pairs of nonnegative integers. Let $N$ denote the number of pairs of integers $(i, j)$ satisfying $1 \leq i<j \leq 100$ and $\left|a_{i} b_{j}-a_{j} b_{i}\right|=1$. Determine the largest possible value of $N$ over all possible choices of the 100 ordered pairs.
The answer is 197 . In general, if 100 is replaced by $n \geq 2$ the answer is $2 n-3$.
The idea is that if we let $P_{i}=\left(a_{i}, b_{i}\right)$ be a point in the coordinate plane, and let $O=(0,0)$ then we wish to maximize the number of triangles $\triangle O P_{i} P_{j}$ which have area $1 / 2$. Call such a triangle good.

ब Construction of 197 points. It suffices to use the points $(1,0),(1,1),(2,1),(3,1)$, $\ldots,(99,1)$ as shown. Notice that:
- There are 98 good triangles with vertices $(0,0),(k, 1)$ and $(k+1,1)$ for $k=1, \ldots, 98$.
- There are 99 good triangles with vertices $(0,0),(1,0)$ and $(k, 1)$ for $k=1, \ldots, 99$. This is a total of $98+99=197$ triangles.

『 Proof that 197 points is optimal. We proceed by induction on $n$ to show the bound of $2 n-3$. The base case $n=2$ is evident.

For the inductive step, suppose (without loss of generality) that the point $P=P_{n}=$ $(a, b)$ is the farthest away from the point $O$ among all points.
Claim - This farthest point $P=P_{n}$ is part of at most two good triangles.

Proof. We must have $\operatorname{gcd}(a, b)=1$ for $P$ to be in any good triangles at all, since otherwise any divisor of $\operatorname{gcd}(a, b)$ also divides $2[O P Q]$. Now, we consider the locus of all points $Q$ for which $[O P Q]=1 / 2$. It consists of two parallel lines passing with slope $O P$, as shown.
Since $\operatorname{gcd}(a, b)=1$, see that only two lattice points on this locus actually lie inside the quarter-circle centered at $O$ with radius $O P$. Indeed if one of the points is $(u, v)$ then the others on the line are $(u \pm a, v \pm b)$ where the signs match. This proves the claim.

This claim allows us to complete the induction by simply deleting $P_{n}$.