Logo
(追記) (追記ここまで)

11759번 - Bottled-Up Feelings 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB65731028452.690%

문제

Peter is expecting a large shipment of fuel oil, but he has a small problem (doesn’t everyone in these programming problems!). The only containers he has are a set of large bottles (each with the same volume) and a set of smaller bottles (also each with the same, but smaller volume). Given the volume of the shipment of oil, he would like to store the oil in the bottles so that

  1. all of the oil is stored,
  2. each bottle is filled to the top, and
  3. the minimum number of bottles is used.

While Peter thinks he has solved this problem for his given bottle sizes, he often spends hours wondering what would happen if his bottles had different volumes (apparently Peter doesn’t lead the most exciting life).

입력

The input consists of a single line containing three positive integers s v1 v2, where s ≤ 106 is the volume of the shipment, and v1, v2 ≤ 106 are the volumes of the two types of bottles, with v1 > v2.

출력

Output the number of bottles of size v1 and the number of bottles of size v2 which satisfy Peter’s two conditions. If the conditions cannot be met, output Impossible.

제한

예제 입력 1

1000 9 7

예제 출력 1

108 4

예제 입력 2

1000 900 7

예제 출력 2

Impossible

예제 입력 3

1000 10 7

예제 출력 3

100 0

힌트

출처

ICPC > Regionals > North America > East Central North America Regional > 2015 East Central Regional Contest 연습 세션 PA번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /