A
#include<bits/stdc++.h>
using namespace std;
int main()
{
int num[3];
cin>>num[0]>>num[1]>>num[2];
sort(num,num+3);
cout<<num[1]+num[2]<<endl;
return 0;
}
B
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll a,b,c,d;
cin>>a>>b>>c>>d;
ll cyn=a;
ll red=0;
for(int i=0;i<100000001ll;i++){
if(red*d>=cyn){
cout<<i<<endl;
return 0;
}
else{
cyn+=b;
red+=c;
}
}
cout<<"-1"<<endl;
return 0;
}
C
#include<bits/stdc++.h>
#define ll long long
using namespace std;
struct num{
ll t;
ll a;
ll b;
};
bool f(num x,num y){
if(x.b<y.a||x.a>y.b)return 0;
else if(x.b==y.a){
if((x.t!=1&&x.t!=3)||(y.t!=1&&y.t!=2))return 0;
}
else if(x.a==y.b){
if((x.t!=1&&x.t!=2)||(y.t!=1&&y.t!=3))return 0;
}
return 1;
}
int main()
{
ll n;
ll ans=0;
cin>>n;
num a[n];
for(ll i=0;i<n;i++){
cin>>a[i].t>>a[i].a>>a[i].b;
}
for(ll i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
if(f(a[i],a[j]))ans++;
}
}
cout<<ans<<endl;
}