시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 25 5 5 41.667%

문제

자연수 N이 주어졌을 때, 두 수 X와 Y의 합이 N이 되는 모든 쌍을 찾는 프로그램을 작성하시오. 이 때, Y는 항상 X에서 숫자를 지운 형태이어야 한다. 따라서, X는 항상 두 자리 이상인 숫자이어야 하고, 0으로 시작할 수 없다. Y는 한 자리 이상인 숫자이어야 하고, 0으로 시작할 수 있다.

입력

자연수 N이 주어진다. (10 ≤ N ≤ 109)

출력

첫째 줄에 문제의 조건을 만족하는 서로 다른 쌍의 개수를 출력한다. 그 다음 줄부터 한 줄에 하나씩 문제의 조건에 맞는 쌍을 X가 증가하는 순서대로 출력하며, 각 쌍은 "X + Y = N" 형식이어야 한다. X, Y, N은 숫자로 바뀌어야 하고, +와 =의 앞과 뒤에는 공백이 한 칸씩 있다.

예제 입력 1

302

예제 출력 1

5
251 + 51 = 302
275 + 27 = 302
276 + 26 = 302
281 + 21 = 302
301 + 01 = 302

힌트

W3sicHJvYmxlbV9pZCI6Ijc0MjQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyMmJcdWM3OTAgXHVjMzBkIiwiZGVzY3JpcHRpb24iOiI8cD5cdWM3OTBcdWM1ZjBcdWMyMTggTlx1Yzc3NCBcdWM4ZmNcdWM1YjRcdWM4NGNcdWM3NDQgXHViNTRjLCBcdWI0NTAgXHVjMjE4IFhcdWM2NDAgWVx1Yzc1OCBcdWQ1NjlcdWM3NzQgTlx1Yzc3NCBcdWI0MThcdWIyOTQgXHViYWE4XHViNGUwIFx1YzMwZFx1Yzc0NCBcdWNjM2VcdWIyOTQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQ0IFx1Yzc5MVx1YzEzMVx1ZDU1OFx1YzJkY1x1YzYyNC4gXHVjNzc0IFx1YjU0YywgWVx1YjI5NCBcdWQ1NmRcdWMwYzEgWFx1YzVkMFx1YzExYyBcdWMyMmJcdWM3OTBcdWI5N2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JcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

ACM-ICPC > Regionals > Europe > Northeastern European Regional Contest > NEERC 2001 H번

  • 문제를 번역한 사람: baekjoon
  • 문제의 오타를 찾은 사람: corea