Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<stdio.h>
- #include<string.h>
- #include<algorithm>
- using namespace std;
- int main()
- {
- unsigned long long a,b,c,p[3],m,l,m1,l1,ll,maxi;
- cin>>a>>b>>c;
- m=0;
- l=0;
- m1=0;
- l1=0;
- p[0]=a;
- p[1]=b;
- p[2]=c;
- sort(p,p+3);
- if(a+b+c>=3)
- {
- while(p[0]>0&&p[2]>=2)
- {
- p[0]=p[0]-1;
- p[2]=p[2]-2;
- sort(p,p+3);
- m++;
- }
- while(p[1]>0&&p[2]>=2)
- {
- p[1]=p[1]-1;
- p[2]=p[2]-2;
- sort(p,p+3);
- m++;
- }
- if(p[0]>0&&p[1]>0||p[0]>0&&p[2]>0||p[1]>0&&p[2]>0||p[0]>0&&p[1]>0&&p[2]>0)
- {
- if(p[0]+p[1]>=3)
- {
- m++;
- }
- if(p[0]+p[2]>=3)
- {
- m++;
- }
- if(p[1]+p[2]>=3)
- {
- m++;
- }
- if(p[1]+p[2]+p[0]>=3)
- {
- m++;
- }
- }
- }
- cout<<m<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement