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

13863번 - Cubes 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.5 초 256 MB65201655.172%

문제

Write a program that takes a natural number N and decomposes it as a sum of the minimum number of exact natural cubes. The program should find m1, m2, …, mk, such that each mi is a natural number, m13 +m23 +… +mk3 = N, and k is minimal.

입력

The only line of the input file contains the number N (1 ≤ N ≤ 44,777,444).

출력

Your program should write exactly two lines. The first line contains the number k - the minimum number of natural cubes. The second line contains k space-separated natural numbers - that raised to the power of 3 sum to N.

제한

예제 입력 1

42

예제 출력 1

7
2 2 2 2 2 1 1

예제 입력 2

43

예제 출력 2

3
3 2 2

힌트

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2016 I번

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

출처

대학교 대회

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

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