310024: CF1773F. Football

Memory Limit:1024 MB Time Limit:3 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Football

题意翻译

科学家正在研究足球比赛结果对球迷情绪的影响。他们有一个假设,平局的数量与球迷未来观看足球比赛的欲望之间存在相关性。 在足球比赛中,两队进行比赛。球队在整场比赛中都有进球。得分“ $x:y$ ”意味着我们观察到的球队打进了 $x$ 球,丢了 $y$ 球。如果 $x=y$ ,则比赛是平局。如果 $x>y$ ,则观察到的团队获胜,如果 $x<y$ ,则观察到的团队失败。 为了找出是否存在相关性,科学家们收集了低级别联赛球队的结果信息。他们发现的信息是球队的比赛次数(记为 $n$ )、这些比赛中的进球数(记为 $a$ )和这些比赛中失球数(记为$b$)。 给定单个团队的信息。计算球队比赛中可能出现的最低平局数,输出包含最低平局数的比赛分数表。 第一行包含一个整数 $n$ ——球队的比赛次数( $1≤n≤100$ ). 第二行包含一个整数 $a$ ——球队在这 $n$ 场比赛中的进球总数( $0≤a≤1000$ ). 第三行包含一个整数 $b$ ——球队在这$n$场比赛中失球的总数( $0≤b≤1000$ )。 在第一行中,输出一个整数$d$——最低平局数。 在以下 $n$ 行中,输出分数列表,每行的格式为“ $x:y$ ”,其中 $x$ 是比赛中的进球数, $y$ 是失球数,因此这些比赛中的 $d$ 场比赛以平局结束。如果存在多个这样的分数列表,请输出其中任何一个。 翻译由[@PCT2506](https://www.luogu.com.cn/user/793625)提供

题目描述

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 " $ x $ : $ y $ " means that the team we observe scored $ x $ goals and conceded $ y $ goals. If $ x = y $ , then the match ends in a draw. If $ x > y $ , then the observed team wins, and if $ x < 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 ( $ n $ ), the number of goals scored in these matches ( $ a $ ), and the number of goals conceded in these matches ( $ b $ ). 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 $ n $ — the number of matches played by the team ( $ 1 \le n \le 100 $ ). The second line contains an integer $ a $ — the total number of goals scored by the team in all $ n $ matches ( $ 0 \le a \le 1000 $ ). The third line contains an integer $ b $ — the total number of goals conceded by the team in all $ n $ matches ( $ 0 \le b \le 1000 $ ).

输出格式


In the first line, print a single integer $ d $ — the minimum number of draws. In the following $ n $ lines, print a list of match scores, each line in the format " $ x $ : $ y $ ", where $ x $ is the number of goals scored in the match, and $ y $ – the number of goals conceded, so that exactly $ d $ of these matches have ended in a draw. In case multiple such lists of match scores exist, print any of them.

输入输出样例

输入样例 #1

3
2
4

输出样例 #1

0
1:0
1:2
0:2

输入样例 #2

1
2
2

输出样例 #2

1
2:2

输入样例 #3

4
0
7

输出样例 #3

0
0:1
0:2
0:1
0:3

输入样例 #4

6
3
1

输出样例 #4

2
0:0
1:0
0:0
0:1
1:0
1:0

Input

题意翻译

科学家正在研究足球比赛结果对球迷情绪的影响。他们有一个假设,平局的数量与球迷未来观看足球比赛的欲望之间存在相关性。 在足球比赛中,两队进行比赛。球队在整场比赛中都有进球。得分“ $x:y$ ”意味着我们观察到的球队打进了 $x$ 球,丢了 $y$ 球。如果 $x=y$ ,则比赛是平局。如果 $x>y$ ,则观察到的团队获胜,如果 $x<y$ ,则观察到的团队失败。 为了找出是否存在相关性,科学家们收集了低级别联赛球队的结果信息。他们发现的信息是球队的比赛次数(记为 $n$ )、这些比赛中的进球数(记为 $a$ )和这些比赛中失球数(记为$b$)。 给定单个团队的信息。计算球队比赛中可能出现的最低平局数,输出包含最低平局数的比赛分数表。 第一行包含一个整数 $n$ ——球队的比赛次数( $1≤n≤100$ ). 第二行包含一个整数 $a$ ——球队在这 $n$ 场比赛中的进球总数( $0≤a≤1000$ ). 第三行包含一个整数 $b$ ——球队在这$n$场比赛中失球的总数( $0≤b≤1000$ )。 在第一行中,输出一个整数$d$——最低平局数。 在以下 $n$ 行中,输出分数列表,每行的格式为“ $x:y$ ”,其中 $x$ 是比赛中的进球数, $y$ 是失球数,因此这些比赛中的 $d$ 场比赛以平局结束。如果存在多个这样的分数列表,请输出其中任何一个。 翻译由[@PCT2506](https://www.luogu.com.cn/user/793625)提供

加入题单

算法标签: