D. [UOI 2024 II Stage] Shops

    远端评测题 1000ms 512MiB

[UOI 2024 II Stage] Shops

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

题目描述

Today is Friday. Anton is finally free from school for two days! Anton can go home in two ways:

  • by taking the first path, Anton can visit aa shops;
  • by taking the second path, Anton can visit bb shops.

Anton also knows that there are cc shops that are encountered on both paths (in both places). Anton is curious about how many shops are there in his city in total? Let's assume that there are no more shops in the city except for these shops.

Help him answer this question.

:::align{center}

Above is one of the possible route options in the second example. :::

输入格式

The first line contains three integers aa, bb, cc (0ca,b1000 \le c \le a, b \le 100) --- the number of shops on the first path, the second path, and on both.

输出格式

Print a single integer --- the total number of shops in the city.

1 2 0
3
9 6 3
12

0817版纳一测

未参加
状态
已结束
规则
IOI
题目
7
开始于
2026-8-17 8:00
结束于
2026-8-17 9:30
持续时间
1.5 小时
主持人
参赛人数
23