시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 888 193 124 24.652%

문제

찰리는 돈을 좀 가지고 있다. 그는 특히 동전에 관심이 좀 있어서 동전을 여러 개 가지고 있다. 그런데 동전이 자꾸 쌓여가자, 그는 처리에 곤란을 느끼고 이 동전들을 처분하기로 마음먹었다.

찰리는 1센트짜리 동전을 A개, 5센트(nickel)짜리 동전을 B개, 10센트(dime)짜리 동전을 C개, 25센트(quarter)짜리 동전을 D개 가지고 있다. 찰리는 이를 이용하여 X원짜리 커피를 사려 하는데, 이때 사용하는 동전의 개수를 최대로 하려 한다.

이러한 정보가 주어질 때, 사용하는 동전의 개수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 다섯 정수 X(1 ≤ X ≤ 10,000), A, B, C, D(0 ≤ A, B, C, D ≤ 10,000)가 주어진다.

출력

첫째 줄에 답을 출력한다. Cent의 수, nickel의 수, dime의 수, quarter의 수를 출력한다. 불가능한 경우에는 0을 네 개 출력한다.

예제 입력 1

12 5 3 1 2

예제 출력 1

2 2 0 0
W3sicHJvYmxlbV9pZCI6IjIwOTEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIzZDlcdWM4MDQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1Y2MzMFx1YjlhY1x1YjI5NCBcdWIzYzhcdWM3NDQgXHVjODgwIFx1YWMwMFx1YzljMFx1YWNlMCBcdWM3ODhcdWIyZTQuIFx1YWRmOFx1YjI5NCBcdWQyYjlcdWQ3ODggXHViM2Q5XHVjODA0XHVjNWQwIFx1YWQwMFx1YzJlY1x1Yzc3NCBcdWM4ODAgXHVjNzg4XHVjNWI0XHVjMTFjIFx1YjNkOVx1YzgwNFx1Yzc0NCBcdWM1ZWNcdWI3ZWMgXHVhYzFjIFx1YWMwMFx1YzljMFx1YWNlMCBcdWM3ODhcdWIyZTQuIFx1YWRmOFx1YjdmMFx1YjM3MCBcdWIzZDlcdWM4MDRcdWM3NzQgXHVjNzkwX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