How to maximize $f(x,y)=\frac{x+y-2}{xy}$?

How to maximize $f(x,y)=\frac{x+y-2}{xy}$ where $x,y\in \{1,2,\dots ,n\}$?

It seems that maximum will occur when $(x,y)=(1,n)$ or $(n,1).$

How to maximize $f(x,y)=\frac{x+y-2}{xy}$ where $x,y\in \{1,2,\dots ,n\}$?

It seems that maximum will occur when $(x,y)=(1,n)$ or $(n,1).$