아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Football

면접 대비

시간 제한3초메모리 제한1024 MB

요약
n경기의 총 득점 a와 총 실점 b가 주어질 때 무승부 수의 최솟값을 구하고, 그에 맞는 경기별 점수를 하나 출력한다.
난이도

보통10점 중 4점

유형
그리디, 수학, 구현, 완전 탐색
정답자
아직 제출이 없습니다

문제

Scientists are researching an impact of football match results on the mood of football fans. They have a hypothesis that there is a correlation between the number of draws and fans' desire to watch football matches in the future.

In football, two teams play a match. The teams score goals throughout a match. A score "xx:yy" means that the team we observe scored xx goals and conceded yy goals. If x=yx = y, then the match ends in a draw. If x>yx > y, then the observed team wins, and if x<yx < y, then it loses.

To find out if there is a correlation, the scientists gathered information about the results of teams in lower leagues. The information they found is the number of matches played by the team (nn), the number of goals scored in these matches (aa), and the number of goals conceded in these matches (bb).

You are given this information for a single team. You are asked to calculate the minimum number of draws that could have happened during the team's matches and provide a list of match scores with the minimum number of draws.

입력

The first line contains an integer nn --- the number of matches played by the team (1≤n≤1001 \le n \le 100). The second line contains an integer aa --- the total number of goals scored by the team in all nn matches (0≤a≤10000 \le a \le 1000). The third line contains an integer bb --- the total number of goals conceded by the team in all nn matches (0≤b≤10000 \le b \le 1000).

출력

In the first line, print a single integer dd --- the minimum number of draws.

In the following nn lines, print a list of match scores, each line in the format "xx:yy", where xx is the number of goals scored in the match, and yy -- the number of goals conceded, so that exactly dd of these matches have ended in a draw. In case multiple such lists of match scores exist, print any of them.

예제4

  1. 예제 1

    입력
    3
    2
    4
    
    예상 출력
    0
    1:0
    1:2
    0:2
    
  2. 예제 2

    입력
    1
    2
    2
    
    예상 출력
    1
    2:2
    
  3. 예제 3

    입력
    4
    0
    7
    
    예상 출력
    0
    0:1
    0:2
    0:1
    0:3
    
  4. 예제 4

    입력
    6
    3
    1
    
    예상 출력
    2
    0:0
    1:0
    0:0
    0:1
    1:0
    1:0