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

23608번 - Taste in Art 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 (추가 시간 없음) 256 MB153240.000%

문제

Maggie has a large collection of modern paintings. She is particularly proud of those depicting colourful squares -- each painting having a different number of squares. She intends to finally make an exhibition of the paintings for her friends, but their sublime tastes require special handling. Maggie knows that if among the presented paintings there are three depicting $k, 2k$ and 3ドルk$ squares, for some $k,ドル then the whole exhibition will be perceived as predictable, thus dull, thus a failure. If no such a $k$ exists, the event will be a great success. On the other hand, Maggie wants to show (off) as many paintings as possible. She spends hours on trying to choose the largest possible number of paintings, yet avoiding a predictability. Help her in this task.

입력

The first line of the input contains a single integer $n$ (1ドル \le n \le 50,000円$), denoting the number of paintings with squares in Maggie's collection. In the second and last line of the input there is a sequence of $n$ pairwise distinct integers $a_i$ (1ドル \le a_i \le 10^9$), each separated by a single space, denoting the number of squares on each of paintings in order.

출력

You should write a single integer in the first and only line of the output -- the largest possible number of Maggie's paintings with squares that can form a non-predictable exhibition.

제한

예제 입력 1

3
6 9 3

예제 출력 1

2

예제 입력 2

6
1 2 3 4 5 6

예제 출력 2

5

노트

In the Sample 1, the three paintings form a predictable exhibition, but any two of them do not.

In the Sample 2, the largest set of paintings that form an unpredictable exhibition includes all paintings except the second one.

출처

Contest > Open Cup > 2018/2019 Season > Stage 6: Grand Prix of Poland G번

ICPC > Regionals > Europe > Central European Regional Contest > Poland Collegiate Programming Contest > AMPPZ 2018 G번

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

출처

대학교 대회

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

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