303515: CF680A. Bear and Five Cards
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Bear and Five Cards
题意翻译
给定5个正整数,你可以从中去除2个或3个相同的数。如果没有相同的数,即不能去除。求去除1次后剩余数字的最小和。 样例1:7 3 7 3 20 去除两个7,剩余3 3 20 ∴ 3 + 3 + 20 = 26 样例2:7 9 3 1 8 ∵ 没有相同的数 ∴ 7 + 9 + 3 + 1 + 8 = 28 样例3:10 10 10 10 10 去除3个10,剩余10 10 ∴ 10 + 10 = 20 translator:Arvin2018题目描述
A little bear Limak plays a game. He has five cards. There is one number written on each card. Each number is a positive integer. Limak can discard (throw out) some cards. His goal is to minimize the sum of numbers written on remaining (not discarded) cards. He is allowed to at most once discard two or three cards with the same number. Of course, he won't discard cards if it's impossible to choose two or three cards with the same number. Given five numbers written on cards, cay you find the minimum sum of numbers on remaining cards?输入输出格式
输入格式
The only line of the input contains five integers $ t_{1} $ , $ t_{2} $ , $ t_{3} $ , $ t_{4} $ and $ t_{5} $ ( $ 1<=t_{i}<=100 $ ) — numbers written on cards.
输出格式
Print the minimum possible sum of numbers written on remaining cards.
输入输出样例
输入样例 #1
7 3 7 3 20
输出样例 #1
26
输入样例 #2
7 9 3 1 8
输出样例 #2
28
输入样例 #3
10 10 10 10 10
输出样例 #3
20