Codeforces Round 220 (Div. 2)
E
Inna and Babies
Codeforces
2600
原题
← D→
翻译中…

Inna, Dima and Sereja are in one room together. It's cold outside, so Sereja suggested to play a board game called "Babies".

翻译中…

The babies playing board is an infinite plane containing $*n*$ blue babies and $*m*$ red ones. Each baby is a segment that grows in time. At time moment $*t*$ the blue baby $(*x*, *y*)$ is a blue segment with ends at points $(*x* - *t*, *y* + *t*)$, $(*x* + *t*, *y* - *t*)$. Similarly, at time $*t*$ the red baby $(*x*, *y*)$ is a red segment with ends at points $(*x* + *t*, *y* + *t*)$, $(*x* - *t*, *y* - *t*)$ of the plane. Initially, at time $*t* = 0$ all babies are points on the plane.

翻译中…

The goal of the game is to find the first integer moment of time when the plane contains a rectangle of a non-zero area which sides are fully covered by some babies. A side may be covered by multiple babies. More formally, each point of each side of the rectangle should be covered by at least one baby of any color. At that, you must assume that the babies are closed segments, that is, they contain their endpoints.

翻译中…

You are given the positions of all babies — help Inna and Dima to find the required moment of time.

翻译中…

Input

翻译中…

The first line of the input contains two integers $*n*$ and $*m*$ $(1 ≤ *n*, *m* ≤ 2000)$.

翻译中…

Next $*n*$ lines contain the coordinates of the blue babies. The $*i*$-th line contains integers $*x*_{*i*}, *y*_{*i*}$ — a baby's coordinates. Next $*m*$ lines contain the coordinates of $*m*$ red babies in the similar form.

翻译中…

All coordinates of the input don't exceed $10^{6}$ in their absolute value. Note that all babies stand in distinct points.

翻译中…

Output

翻译中…

In the single line print a single integer — the answer to the problem.

翻译中…

If the rectangle never appears on the plane, print "Poor Sereja!" without the quotes.

翻译中…

样例

Input #1
2 2
2 2
5 5
3 7
5 1
Output #1
3
InputCopy OutputCopy
Input #2
3 2
2 2
3 2
6 2
4 2
5 2
Output #2
1
InputCopy OutputCopy
题目信息
题号
374E
时间限制
6 s
内存限制
256 MB
标签
二分
数据结构
并查集
计算几何
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。