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

20743번 - Bus Numbers 다국어

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

문제

A famous story about the mathematicians G.H. Hardy and Srinivasa Ramanujan goes as follows (as told by Hardy):

I remember once going to see him (Ramanujan) when he was lying ill at Putney. I had ridden in taxicab No. 1729, and remarked that the number seemed to be rather a dull one, and that I hoped it was not an unfavourable omen. "No", he replied, "it is a very interesting number; it is the smallest number expressible as the sum of two [positive] cubes in two different ways."

It is from this story the taxicab numbers got their name. The $n$'th taxicab numbers is defined to be the smallest number that can be expressed as a sum of two positive cube numbers in $n$ distinct ways.

It turns out that these numbers grows rather quickly. This makes them very hard to compute, which is not very fun. A variation of the concept is to consider what we will call the bus numbers -- all the numbers which can expressed as the sum of two positive cube numbers in at least 2ドル$ distinct ways. Note that according to this definition, all taxicab numbers (except the first) are also bus numbers.

Your task is to write a program that generates bus numbers; in particular, the largest bus number that is at most equal to some limit $m$.

입력

The input consists of:

  • one line with an integer $m$ (1ドル \le m \le 400,000円$), the upper bound of the bus number.

출력

Output the largest bus number $x$ which does not exceed $m$. If there is no such number, output none.

제한

예제 입력 1

1730

예제 출력 1

1729

예제 입력 2

100

예제 출력 2

none

힌트

출처

Contest > Swedish Coding Cup > LTH Challenge 2017 B번

  • 문제를 만든 사람: Måns Magnusson
(追記) (追記ここまで)

출처

대학교 대회

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

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