-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path322B.cpp
More file actions
75 lines (69 loc) · 1.67 KB
/
322B.cpp
File metadata and controls
75 lines (69 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define eb emplace_back
#define pb push_back
#define ALL(X) X.begin(), X.end()
#define rALL(X) X.rbegin(), X.rend()
typedef long long loli;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<loli,loli> pll;
typedef pair<pll,pll> pllll;
typedef string str;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<loli> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<ld> vld;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<str> vs;
#define maxn 200005
//int a[maxn];
//ifstream fin("test.in");
//ofstream fout("test.out");
void print(vi nums){
for(auto &i :nums){
cout <<i <<" ";
}cout << endl;
}
void print(vvi nums){
for(auto &i:nums){
print(i);
}
}
void _solve(){
int nums[3];
for(int i =0;i<3;i++){cin >>nums[i];}
sort(nums,nums+3);
int ans = 0 ;
if(!nums[0]){
cout << nums[1]/3+nums[2]/3;
}else if (nums[0] ==1){
int temp = nums[1]/3+nums[2]/3;
int temp2 = 1+(nums[1]-1)/3+(nums[2]-1)/3;
cout << max(temp,temp2)<<endl;
}else{
int temp1=nums[0]+(nums[1]-nums[0])/3+(nums[2]-nums[0])/3;
int temp2=nums[0]-1+(nums[1]-nums[0]+1)/3+(nums[2]-nums[0]+1)/3;
int temp3=nums[0]-2+(nums[1]-nums[0]+2)/3+(nums[2]-nums[0]+2)/3;
ans=max(max(temp1,temp2),temp3);
cout <<ans;
}
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int _ = 1;
//cin >>_;
while(_--){
_solve();
}
}