TORONTO KIDS COMPUTER CLUB | PMCA Friday 19:00 Python Homework 21.04.30.
post-template-default,single,single-post,postid-19356,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Friday 19:00 Python Homework 21.04.30.

04 May PMCA Friday 19:00 Python Homework 21.04.30.

The city of Osijek has recently been plagued by a swarm of mosquitoes. The solution to this problem was proposed long ago by Mr. Perić, a brave inventor from Benkovci, in an episode of the TV-show Gitak called “Globalno sjelo”. Among other inspiring inventions, he presented a mosquito trap. It is basically a box which you cover the mosquito after it falls for the piece of cheese or “kajmak” you placed there, depending on what your mosquitoes prefer. Simple, isn’t it?

If you’re lucky, the box can cover more than one mosquito. You have spotted N mosquitoes on the table and know their positions precisely. What is the area of the smallest square-shaped box that can, placed parallel to the sides of the table, cover all the mosquitoes? The box of course, can cover the mosquito with its edge.

The first line of input contains the integer N (2≤N≤20), the number of spotted mosquitoes.
Each of the following N lines contains the positions of mosquitoes as space-separated integer coordinates X and Y (1≤X,Y≤100) in an imaginary coordinate system whose axes are the sides of the table. At least two mosquitoes will be in different positions.

The first and only line of output must contain the required area of the smallest square-shaped box (expressed, of course, in unit squares of the aforementioned coordinate system).

Sample Input 1
3 4
5 7
4 3
Sample Output 1

Clarification of Output for Sample Input 1
A square with vertices (3,3) and (7,7) solves all the problems.

Sample Input 2
1 5
5 1
10 5
5 10
Sample Output 2

No Comments

Sorry, the comment form is closed at this time.