시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
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
W3sicHJvYmxlbV9pZCI6Ijc0MjQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyMmJcdWM3OTAgXHVjMzBkIiwiZGVzY3JpcHRpb24iOiI8cD5cdWM3OTBcdWM1ZjBcdWMyMTggTlx1Yzc3NCBcdWM4ZmNcdWM1YjRcdWM4NGNcdWM3NDQgXHViNTRjLCBcdWI0NTAgXHVjMjE4IFhcdWM2NDAgWVx1Yzc1OCBcdWQ1NjlcdWM3NzQgTlx1Yzc3NCBcdWI0MThcdWIyOTQgXHViYWE4XHViNGUwIFx1YzMwZFx1Yzc0NCBcdWNjM2VcdWIyOTQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQ0IFx1Yzc5MVx1YzEzMVx1ZDU1OFx1YzJkY1x1YzYyNC4gXHVjNzc0XHViNTRjLCBZXHViMjk0IFx1ZDU2ZFx1YzBjMSBYXHVjNWQwXHVjMTFjIFx1YzIyYlx1Yzc5MFx1Yjk3YyBc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IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

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

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