시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 106 24 21 28.378%

문제

김상근 백작은 한국의 대표적인 뱀파이어이다. 김상근 백작의 공격을 방어하려면 아래와 같은 식을 암기해야 한다.

(a/b)^3 + (c/b)^3 = n

여기서 a, b, c, n은 자연수이다. 예를 들면, 아래와 같은 식이다.

(415280564497/348671682660)^3 + (676702467503/348671682660)^3 = 9 

그런데, 위와 같은 식은 너무 길다. 이렇게 긴 식을 외우면, 외우는 도중에 김상근 백작이 공격을 할 것이고, 이 문제를 읽는 당신은 뱀파이어로 변한다. 따라서, 아래와 같은 짧은 식을 외우는 것이 좋다.

(2/1)^3 + (1/1)^3 = 9

n이 주어졌을 때, 암기하기 쉬운 식을 찾는 프로그램을 작성하시오. 암기하기 쉬운 식이란, a+b+c+b가 가장 작은 식이고, a/b가 c/b보다 크거나 같아야 한다. 이 조건을 만족하는 식은 항상 유일하다. 만약, 4000보다 작은 a+b+c+b가 없다면 "No value."를 출력한다.

입력

입력은 여러 개의 테스트 케이스로 이루어져 있으며, 각 테스트 케이스는 10,000보다 작은 자연수 n이 하나 주어진다. 입력의 마지막 줄에는 0이 하나 주어진다.

출력

암기하기 쉬운 식을 찾아 출력한다. +와 =의 앞과 뒤에는 공백을 하나 출력해야 한다.

예제 입력 1

1
9
7
6000
0

예제 출력 1

No value.
(2/1)^3 + (1/1)^3 = 9
(5/3)^3 + (4/3)^3 = 7
(370/21)^3 + (170/21)^3 = 6000
W3sicHJvYmxlbV9pZCI6IjQ0NjEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjNDBcdWQzMGNcdWM3NzRcdWM1YjQgXHVhZTQwXHVjMGMxXHVhZGZjIFx1YmMzMVx1Yzc5MSIsImRlc2NyaXB0aW9uIjoiPHA+XHVhZTQwXHVjMGMxXHVhZGZjIFx1YmMzMVx1Yzc5MVx1Yzc0MCBcdWQ1NWNcdWFkNmRcdWM3NTggXHViMzAwXHVkNDVjXHVjODAx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