program kouzlo; const max = 1000; { Sklep s více vrcholy už je prakticky kruhový } type tcoord = record x, y: real; end; tcorners = array[0..max-1] of tcoord; var n: integer; corners: tcorners; f: text; best, bestLoc: real; bestPos, bestPair1, bestPair2: integer; i: integer; function dist2(i, j: integer): real; begin dist2 := (corners[i].x - corners[j].x) * (corners[i].x - corners[j].x) + (corners[i].y - corners[j].y) * (corners[i].y - corners[j].y); end; begin { Trocha načítání } assign(f, 'kouzlo.in'); reset(f); n := 0; while not seekeof(f) do begin read(f, corners[n].x, corners[n].y); inc(n); end; close(f); { Zatím nic nenalezeno } bestPos := 1; best := 0; { Ke všem najdeme ten nejlepší} for i := 0 to n - 1 do begin bestLoc := dist2(i, bestPos mod n); { Posouváme tak dlouho, dokud se to zlepšuje } while dist2(i, (bestPos + 1) mod n) > bestLoc do begin inc(bestPos); bestLoc := dist2(i, bestPos mod n); end; { Zlepšilo se celkově? } if bestLoc > best then begin bestPair1 := i; bestPair2 := bestPos mod n; best := bestLoc; end; end; { Vypsat } writeln('[', corners[bestPair1].x, ',', corners[bestPair1].y, '], [', corners[bestPair2].x, ',', corners[bestPair2].y, ']'); end.