#include<iostream>#include<cstring>usingnamespace std;intmain(){int a, b;
cin >> a >> b;if(a >12) cout << b << endl;elseif(a >=6) cout << b /2<< endl;else cout <<"0"<< endl;return0;}
#include<iostream>#include<cstring>#defineintlonglongusingnamespace std;signedmain(){int r, d, x, ans;
cin >> r >> d >> x;
ans = x;for(int i =1; i <=10;i ++){
ans = r * ans - d;
cout << ans << endl;}return0;}
#include<iostream>#include<cstring>#include<algorithm>usingnamespace std;signedmain(){int n, m, l =0, r =0x3f3f3f3f;
cin >> n >> m;for(int i =0; i < m ;i ++){int x, y; cin >> x >> y;
l =max(l, x), r =min(r, y);}if(r - l >=0) cout << r - l +1<< endl;else cout <<"0"<< endl;return0;}
#include<iostream>#include<algorithm>#defineintlonglongusingnamespace std;constint N =1e5+10;int n, m, a[N];
pair<int,int> b[N];signedmain(){
cin >> n >> m;for(int i =0;i < n ;i ++) cin >> a[i];sort(a, a + n);for(int i =0;i < m ;i ++) cin >> b[i].first >> b[i].second;sort(b, b + m,[&](pair<int,int>&v1, pair<int,int>&v2){return v1.second > v2.second;});int res =0;int i =0, j =0;while(i < m && j < n){for(int k =0; k < b[i].first && j < n ; k ++){if(a[j]> b[i].second)goto xxx;
res += b[i].second;
j ++;}
i ++;}
xxx:for(int i = j; i < n; i ++) res += a[i];
cout << res << endl;return0;}
#include<iostream>#include<algorithm>#include<cstring>usingnamespace std;#defineLLlonglong
LL powmod(LL a,LL b,LL MOD){
LL ans=1;while(b){if(b%2) ans = ans * a % MOD;
a = a * a % MOD;
b /=2;}return ans;}constint N =2e5+511;const LL mod=1e9+7;
LL fac[N],inv[N];int n,m,k;voidP(){
fac[0]=inv[0]=1;for(int i=1;i<=2e5;i++)fac[i]=fac[i-1]*i%mod;
inv[200000]=powmod(fac[200000],mod-2,mod);for(int i=200000-1;i>=1;i--)inv[i]=inv[i+1]*(i+1)%mod;}
LL get(int a,int b){if(b==0)return1;return fac[a]*inv[b]%mod*inv[a-b]%mod;}intmain(){
ios::sync_with_stdio(false);P();
cin>>n>>m>>k;
LL ans=0;for(LL i=1;i<m;i++)ans=(ans+(m-i)*i%mod*n%mod*n%mod)%mod;//固定两个他们纵坐标的差为i,一共可以选(m-i)* n * n 个for(LL i=1;i<n;i++)ans=(ans+(n-i)*i%mod*m%mod*m%mod)%mod;
ans=ans*get(n*m-2,k-2)%mod;
cout<<ans<<endl;return0;}
#include<iostream>#include<cstring>#include<queue>#include<algorithm>#defineintlonglongusingnamespace std;
priority_queue<int> h;
priority_queue<int, vector<int>, greater<int>> l;//一大一小,维护一个对顶堆来查找所有约束条件的中位数signedmain(){int q, res =0;
ios::sync_with_stdio(false);
cin.tie(0);
cin >> q;while(q --){int t;
cin >> t;if(t ==1){int a, b; cin >> a >> b;
res += b;
h.push(a), l.push(a);if(h.top()> l.top())//大根堆的最大值 > 小根堆的小值: 交换{int v1 = h.top(), v2 = l.top();
h.pop(), l.pop();
h.push(v2), l.push(v1);//v1、v2差的绝对值极为所有以加入条件的中位数
res +=abs(v1 - v2);}}else{
cout << h.top()<<" "<< res << endl;}}return0;}