Thickest Burger
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 63 Accepted Submission(s): 60Problem DescriptionACM ICPC is launching a thick burger. The thickness (or the height) of a piece of club steak is A (1 ≤ A ≤ 100). The thickness (or the height) of a piece of chicken steak is B (1 ≤ B ≤ 100).
The chef allows to add just three pieces of meat into the burger and he does not allow to add three pieces of same type of meat. As a customer and a foodie, you want to know the maximum total thickness of a burger which you can get from the chef. Here we ignore the thickness of breads, vegetables and other seasonings.InputThe first line is the number of test cases. For each test case, a line contains two positive integers A and B.OutputFor each test case, output a line containing the maximum total thickness of a burger.Sample Input10 68 42 1 35 25 70 59 79 65 63 46 6 28 82 92 62 43 96 37 28Sample Output178 71 165 217 193 98 192 246 235 102HintConsider the first test case, since 68+68+42 is bigger than 68+42+42 the answer should be 68+68+42 = 178. Similarly since 1+35+35 is bigger than 1+1+35, the answer of the second test case should be 1+35+35 = 71.SourceRecommendjiangzijing2015 | We have carefully selected several similar problems for you: 5960 5959 5958 5957 5956Statistic | Submit | Discuss | Note
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=5948
题目大意:
给a,b求a+b+max(a,b)
题目思路:
【模拟】
水题,直接模拟即可。
1 // 2 //by coolxxx 3 //#include<bits/stdc++.h> 4 #include<iostream> 5 #include<algorithm> 6 #include<string> 7 #include<iomanip> 8 #include<map> 9 #include<stack> 10 #include<queue> 11 #include<set> 12 #include<bitset> 13 #include<memory.h> 14 #include<time.h> 15 #include<stdio.h> 16 #include<stdlib.h> 17 #include<string.h> 18 //#include<stdbool.h> 19 #include<math.h> 20 #pragma comment(linker,"/STACK:1024000000,1024000000") 21 #define min(a,b) ((a)<(b)?(a):(b)) 22 #define max(a,b) ((a)>(b)?(a):(b)) 23 #define abs(a) ((a)>0?(a):(-(a))) 24 #define lowbit(a) (a&(-a)) 25 #define sqr(a) ((a)*(a)) 26 #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b)) 27 #define mem(a,b) memset(a,b,sizeof(a)) 28 #define eps (1e-8) 29 #define J 10000 30 #define mod 1000000007 31 #define MAX 0x7f7f7f7f 32 #define PI 3.14159265358979323 33 #define N 24 34 #define M 1004 35 using namespace std; 36 typedef long long LL; 37 double anss; 38 LL aans; 39 int cas,cass; 40 int n,m,lll,ans; 41 42 int main() 43 { 44 #ifndef ONLINE_JUDGE 45 // freopen("1.txt","r",stdin); 46 // freopen("2.txt","w",stdout); 47 #endif 48 int i,j,k; 49 int x,y,z; 50 // init(); 51 for(scanf("%d",&cass);cass;cass--) 52 // for(scanf("%d",&cas),cass=1;cass<=cas;cass++) 53 // while(~scanf("%s",s)) 54 // while(~scanf("%d%d",&n,&m)) 55 { 56 scanf("%d%d",&n,&m); 57 printf("%d ",n+m+max(n,m)); 58 } 59 return 0; 60 } 61 /* 62 // 63 64 // 65 */