Untitled
unknown
plain_text
3 years ago
3.7 kB
16
Indexable
// Bismillahir Rahmanir Rahim
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define all(x) (x).begin(), (x).end()
#define asort(s) (sort(s.begin(), s.end()))
#define REV(v) (reverse(v.begin(),v.end()))
#define count_n(v,n) (count(v.begin(),v.end(),n))
#define max_v(a) (*max_element(a.begin(),a.end()))
#define t_sum(sv) (accumulate(sv.begin(),sv.end(),0ll))
#define mini_v(a) (*min_element((a).begin(), (a).end()))
#define dsort(s) (sort(s.begin(), s.end(),greater <>()))
#define binary(b,value) (binary_search(b.begin(),b.end(),value))
#define uper_b(b,value) (upper_bound (b.begin(),b.end(),value))
#define Low_b(b,value) (lower_bound (b.begin(),b.end(),value))
#define scan(n,x) for(ll i=0 ; i<n ; i++) {ll nx; cin >> nx; x.pb(nx);}
#define print(x) for(auto &value : x){ cout << value << " ";}cout << endl;
#define sz(v) ((ll)(v).size())
#define cos(a) cos(a*pi/180)
#define sin(a) sin(a*pi/180)
#define tan(a) tan(a*pi/180)
ll sum_digit(ll x) { ll sum=0; while(x>0){ sum+=x%10; x/=10; } return sum; }
ll reverse_num(ll n){ ll tmp=n, ans=0, r; while(tmp>0){ r=tmp%10; ans=ans*10+r; tmp/=10; } return ans; }
#define scanv(n,v) for(i=0;i<n;i++){ll x; cin>>x,v.pb(x);}
#define pi 3.141592654
#define pb push_back
#define w(n) while(n--)
#define f first
#define s second
#define nl "\n"
#define bye break;
#define edl cout<<endl;
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#pragma GCC optimize("Ofast")
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
bool is_not_prime[10001]; ll n =1000; vector<ll>primes;
void seive()
{
ll i,j;
is_not_prime[0]=1; is_not_prime[1]=1;
for(i=2;i<=sqrt(n);i++) { if(is_not_prime[i]==0) { primes.pb(i); for(j=i*i;j<=n;j+=i) { is_not_prime[j]=1; } } }
}
int main()
{
ll t;
cin >> t;
ll x,y;
cin >> x >> y;
if(t == 1)
{
if(x == y && y == 0)
{
cout << 1 << endl;
cout << 0 << ":" << 0 << endl;
}
else
{
cout << 1 << endl;
cout << x << ":" << y << endl;
}
}
else if((x+y) <= t)
{
cout << t - (x+y) << endl;
for(ll i=1; i<=x; i++)
{
cout << 1 << ":" << 0 << endl;
}
for(ll i=1; i<=y; i++)
{
cout << 0 << ":" << 1 << endl;
}
for(ll i=1; i<=(t-(x+y)); i++)
{
cout << 0 << ":" << 0 << endl;
}
}
else if( (x+y) > t)
{
cout << 0 << endl;
ll match = t-2;
for(ll i=1; i<=match; i++)
{
if(x >= 1)
{
cout << 1 << ":" << 0 << endl;
x--;
}
else if(y >= 1)
{
cout << 0 << ":" << 1 << endl;
y--;
}
}
if(x==0 || y == 0)
{
if(x == 0)
{
cout << 0 << ":" << 1 << endl;
cout << 0 << ":" << (y-1) << endl;
}
else
{
cout << 1 << ":" << 0 << endl;
cout << (x-1) << ":" << 0 << endl;
}
}
else
{
cout << x << ":" << 0 << endl;
cout << 0 << ":" << y << endl;
}
}
return 0;
}Editor is loading...