#C. 午饭 (lunch)

    Type: Default 1000ms 256MiB

午饭 (lunch)

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

[丛雨]来到一家餐馆吃午饭。菜单里 44 道菜,价格分别为 a1,a2,a3,a4a_1, a_2, a_3, a_4 元,还有 33 道甜品,价格分别为 b1,b2,b3b_1, b_2, b_3 元。丛雨需要点一道菜和一道甜品,但丛雨又不想花费太多钱,请你帮帮她找出最小需要花费多少元。

输入格式(lunch.in)

第一行包括四个整数 a1,a2,a3,a4a_1, a_2, a_3, a_4 ,表示每道菜的价格。 第二行包括三个整数 b1,b2,b3b_1, b_2, b_3 ,表示每道甜品的价格。

输出格式(lunch.out)

输出一行一个整数,表示丛雨最少需要花费多少元。

输入样例

7 1 6 7
5 4 9

输出样例

5

数据范围

对于 100%100\% 的数据,满足 1a1,a2,a3,a4,b1,b2,b310001 \le a_1, a_2, a_3, a_4, b_1, b_2, b_3 \le 1000

0805

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2024-8-5 9:00
End at
2024-8-5 12:00
Duration
3 hour(s)
Host
Partic.
31