306558: CF1214B. Badges
Memory Limit:512 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Badges
题意翻译
## 题目描述 简化版题意: 有两个取值为 $[0, b]$ 和 $[0, g]$ 的整数 $B$ 和 $G$ , 求有多少对 $(B, G)$ 满足 $B + G = n$ ? ## 输入格式 三行, 每行一个整数, 依次为 $b$ , $g$ , $n$ . ## 输出格式 一行一个整数, 表示满足条件的不同 $(B, G)$ 对的个数. ## 数据范围 $1 \leq b, g \leq 300$, $1 \leq n \leq b + g$题目描述
There are $ b $ boys and $ g $ girls participating in Olympiad of Metropolises. There will be a board games tournament in the evening and $ n $ participants have accepted the invitation. The organizers do not know how many boys and girls are among them. Organizers are preparing red badges for girls and blue ones for boys. Vasya prepared $ n+1 $ decks of badges. The $ i $ -th (where $ i $ is from $ 0 $ to $ n $ , inclusive) deck contains $ i $ blue badges and $ n-i $ red ones. The total number of badges in any deck is exactly $ n $ . Determine the minimum number of decks among these $ n+1 $ that Vasya should take, so that there will be a suitable deck no matter how many girls and boys there will be among the participants of the tournament.输入输出格式
输入格式
The first line contains an integer $ b $ ( $ 1 \le b \le 300 $ ), the number of boys. The second line contains an integer $ g $ ( $ 1 \le g \le 300 $ ), the number of girls. The third line contains an integer $ n $ ( $ 1 \le n \le b + g $ ), the number of the board games tournament participants.
输出格式
Output the only integer, the minimum number of badge decks that Vasya could take.
输入输出样例
输入样例 #1
5
6
3
输出样例 #1
4
输入样例 #2
5
3
5
输出样例 #2
4