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

5102번 - Sarah's Toys 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB94262257266.280%

문제

Sarah, aged 5, has lots and lots of stuffed toys. They are supposed to be kept in her bedroom, but do not always make it back each night.

When she gets into bed at night, she puts the stuffed toys that are in her room on the spare bed. She likes to give each stuffed toy a friend for the night and puts them into pairs. Sometimes there isn’t an even number, so she might have to make one group of 3.

Your task is to write a program that will report on the arrangement of Sarah's toys on a particular night.

입력

Input will be a number of lines, with each line representing a night in Sarah’s house. Each line will have 2 whole numbers, separated by a space. The first number is how many stuffed toys she owns at the time. The second number is the number of toys left round the house that don’t make it back to Sarah’s bedroom that night.

The last line will be 0 0. Do not process this line.

출력

Output will consist of 2 numbers separated by a space for each night. The first represents how many pairs there are and the second will be either a 0 or a 1. A 0 means there were no groups of 3 and a 1 represents that there was one group of 3.

제한

예제 입력 1

7 3
6 3
5 4
0 0

예제 출력 1

2 0
0 1
0 0

힌트

출처

ICPC > Regionals > South Pacific > South Pacific Region > New Zealand Programming Contest > NZPC 2010 C번

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

출처

대학교 대회

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

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