Logo
(追記) (追記ここまで)

17816번 - Beer Vision 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB41171538.462%

문제

We are given a (drunken) image of stars as seen by a drunken man lying on his back on the grass in the vicinity of a closed pub late in the evening. His image is a blend of one original (sober) image, and a copy of the same image shifted by some fixed (X, Y ) nonzero vector. Only the resulting blended image is perceived by the drunkard. Neither the original sober image nor the shift vector are available to him and to us, unfortunately.

An act of humanity would be to restore his perceived image to the version seen by his sober fellow citizens.

Given an image, write a program which calculates how many distinct (X, Y ) vectors exist such that the drunken image can be created by merging some original sober image with its copy shifted by the vector.

Note that if the images of two different stars — one in the original image and the other in its shifted copy — overlap in the blended image, then the drunken image, which is also the input of the program, contains only one entry for this position.

입력

The first line of input contains an integer N (0 < N ≤ 1000), the number of stars in the blended (drunken) image. Next, there are N lines, each with two space-separated integers Xi, Yi (−1000 ≤ Xi, Yi ≤ 1000) describing the position of a star. All stars are regarded to be points with no dimensions.

출력

Print the number of distinct vectors with non-zero length which can be applied to an unknown sober picture to produce the input drunken image. The unknown image might be different in different cases.

제한

예제 입력 1

5
0 0
1 1
2 2
2 0
3 1

예제 출력 1

2

예제 입력 2

3
0 0
0 1
1 0

예제 출력 2

0

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CTU Open Contest > CTU Open Contest 2019 V번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /