시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 2443 755 598 35.830%

문제

맨체스터 유나이티드의 감독 퍼거슨은 빨간 사과를 R개, 초록 사과를 G개 가지고 있다. 훈련장에 있는 선수들 중 몇 명에게 나누어 주려고 한다. 단, 선수들이 서로 같은 개수의 사과를 받지 못하면 경기력 저하가 나타날 수 있으므로 모든 선수에게 같은 개수를 주려고 한다. 퍼거슨 감독은 사과를 싫어한다. 따라서 사과가 남으면 안된다.

예를 들어, 퍼거슨이 빨간 사과를 4개, 초록 사과를 8개 가지고 있다면, 다음과 같이 세가지 방법으로 나누어 줄 수 있다.

  1. 선수 1명에게 빨간 사과 4개와 초록 사과 8개를 줄 수 있다.
  2. 선수 2명에게 빨간 사과 2개와 초록 사과 4개를 각각 줄 수 있다.
  3. 선수 4명에게 빨간 사과 1개와 초록 사과 2개를 각각 줄 수 있다.

퍼거슨이 사과를 나누어 주는 방법을 구하는 프로그램을 작성하시오. 훈련장에 선수는 무한히 많다.

입력

첫째 줄에 R과 G가 주어진다. (1 ≤ R, G ≤ 1,000,000,000)

출력

퍼거슨이 사과를 나누어 주는 방법을 출력한다. 방법을 출력할 때는 사과를 받게되는 선수의 수 N과 나누어 주는 빨간 사과의 수 X와 초록 사과의 수 Y를 출력한다.

각 방법은 한 번만 출력해야 한다. 나누어 주는 방법은 아무 순서로 출력해도 된다.

예제 입력 1

4 8

예제 출력 1

1 4 8
2 2 4
4 1 2
W3sicHJvYmxlbV9pZCI6IjI5NDIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQzN2NcdWFjNzBcdWMyYThcdWFjZmMgXHVjMGFjXHVhY2ZjIiwiZGVzY3JpcHRpb24iOiI8cD5cdWI5ZThcdWNjYjRcdWMyYTRcdWQxMzAgXHVjNzIwXHViMDk4XHVjNzc0XHVkMmYwXHViNGRjXHVjNzU4IFx1YWMxMFx1YjNjNSBcdWQzN2NcdWFjNzBcdWMyYThcdWM3NDAgXHViZT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