akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFやMODの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const ll MOD = 1000000007;

int main() {
  int o = 0, e = 0;
  vector<int> x(3);
  rep(i, 3) {
    cin >> x[i];
    if (x[i] % 2)
      o++;
    else
      e++;
  }

  int ans = 0;

  if (o == 2) {
    rep(i, 3) if (x[i] % 2) x[i]++;
    ans++;
  } else if (e == 2) {
    rep(i, 3) if (x[i] % 2 == 0) x[i]++;
    ans++;
  }

  sort(all(x));
  rep(i, 3) ans += (x[2] - x[i]) / 2;

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <unistd.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
long long int INF = 3e18;
const ll fact_table = 5000000;
double Pi = 3.1415926535897932384626;
 
//vector<ll> G[550010];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←
 
 
#define p(x) cout<<x<<"\n";
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
 
 
//ll mod = 998244353;
ll mod = 1000000007;
 
ll rui(ll number1,ll number2){
 
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
 
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
 
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
 
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
 
/*
ll fact[fact_table + 5],rfact[fact_table + 5];
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = rui(fact[fact_table],mod - 2);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}
 */
ll n,m,num,sum,a,b,c,d,e,g,h,w,i,j,q,r,l;
ll k;
ll ans;
ll x[500005], y[500005], z[500005];
char s[400004];

int main(){
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> x[i];
    }
    y[0] = 3;
    ans = 1;
    for(int i=0;i<n;i++){
        ans *= y[x[i]];
        y[x[i]] --;
        y[x[i] + 1] ++;
        ans %= mod;
    }
    p(ans);

    
    return 0;
    
}


















Measured memory_bytes: 17920
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve(){
	int a,b;
	cin >> a >> b;
	if(a >= 13){
		cout << b << '\n';
	}
	else if(a >= 6 && a <= 12){
		cout << b/2 << '\n';
	}
	else{
		cout << "0\n";
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t = 1;
	//cin >> t;
	while(t--){ 
		solve();
	}
	return 0;
}

Measured memory_bytes: 256
HW = input().split()
H, W = int(HW[0]), int(HW[1])
S = [input() for _ in range(H)] 
result = [[0 for _ in range(W)] for _ in range(H)]

ans = 'Yes'
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    else:
      if (i-1 >= 0 and j-1 >= 0 and S[i-1][j] == '.') and (j-1 >= 0 and S[i][j-1] == '.') and ( j+1 < W and S[i][j+1] == '.') and (i+1 < H and S[i+1][j] == '.'):
        ans = 'No'
print(ans)

Measured memory_bytes: 3064
x = int(input())


def is5(n):
    mi = 0
    ma = n
    while mi != ma:
        mm = (mi + ma) // 2
        if mm ** 5 >= n:
            ma = mm
        else:
            mi = mm + 1
    return mi ** 5 == n, mi


a = 0
while True:
    bb = a ** 5 - x
    if bb >= 0:
        ok, b = is5(bb)
        if ok:
            print(a, b)
            break
    else:
        ok, b = is5(-bb)
        if ok:
            print(a, -b)
            break
    a += 1


Measured memory_bytes: 67396
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin>>n;
	
	cout<<n*(n+1)/2<< endl; 
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::pair;

using std::vector;
using std::sort;

int main(){
    vector<int> v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(),v.end());

    if(v[0]%2 == v[1]%2){
        cout << (v[1]-v[0])/2+v[2]-v[1] << endl;
    }
    else if(v[0]%2 == v[2]%2){
        cout << (v[2]-v[0])/2+(v[2]-v[1]+1)/2+1 << endl;
    }
    else{
        cout << (v[2]-v[1])/2+(v[2]-v[0]+1)/2+1 << endl;
    }
    return 0;
}



Measured memory_bytes: 256
# coding: utf-8
X, Y, A, B, C = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))
P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)
ans = 0
L = P[:X] + Q[:Y]
Rt = [False for _ in range(C)]
L.sort()
idx = 0
for i in range(X+Y):
    if idx >= C:
        break
    if L[i] < R[idx]:
        L[i] = R[idx]
        idx += 1
print(sum(L))

Measured memory_bytes: 108268
#include <bits/stdc++.h>
using namespace std;
int main()
{
    char a;
	cin>>a;
	if(a=='A')
	{
		cout<<'T';
		return 0;
	}
	else if(a=='T')
	{
		cout<<'A';
		return 0;
	}
	else if(a=='C')
	{
		cout<<'G';
		return 0;
	}
	else if(a=='G')
	{
		cout<<'C';
		return 0;
	}
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {

	int i = 1;
	int a,b;

	while(1){
		scanf("%d %d",&a,&b);
		if((a == 0) && (b == 0)){
			break;	
		}
		if( a < b){
			printf("%d %d\n",a,b);	
		}else{
			printf("%d %d\n",b,a);	
		}
		
	}

	return 0;
}



Measured memory_bytes: 2040
#include <stdio.h>
#include <string.h>
#include <math.h>
using namespace std;

int main(void){
    char s[200050];
    int i, j, max = 0, n;
   int  st,gl;
    int cnt;

    scanf("%s", s);
    n = strlen(s);

    for (i = 0; i < n - 1;i++){
        cnt = 0;
        if(s[i]=='A'){
            st = i;
            break;
            }
    }
    for (j = n; j >= 0;j--){
            if(s[j] == 'Z'){
                gl = j;
                break;
            }
    }
    cnt = gl - st+1;
    if (max < cnt)
        max = cnt;
        
    printf("%d\n", max);
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N;
	cin >> N;

	int s = sqrt( N * 2 );
	int sum = s * (s + 1) / 2;
	int n;
	for( n = s; sum < N; n++ ) {
		sum = n * (n + 1) / 2;
	}
	if( sum > N && n * (n - 1) / 2 - N >= 0 ) n--;
	sum = n * (n + 1) / 2;
	int r = sum - N;

	for( int i = 1; i <= n; i++ ) {
		if( i == r ) continue;
		cout << i << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    long long n,c[5];
    
    for(int i=0;i<5;i++){c[i]=0;}
    char name[11];
    cin>>n;
    for(int i=0;i<n;i++)
    {
        scanf("%s",name);
        if(name[0]=='M')c[0]++;
        else if(name[0]=='A')c[1]++;
        else if(name[0]=='R')c[2]++;
        else if(name[0]=='C')c[3]++;
        else if(name[0]=='H')c[4]++;
    }
    long long x=0;
    for(int i=0;i<5;i++)
    {
        for(int j=0;j<5;j++)
        {
            for(int k=0;k<5;k++)
            {
                if(i!=j&&j!=k&&k!=i)
                    x+=c[i]*c[j]*c[k];
            }
        }
    }
    cout<<x/6<<endl;
    return 0;
}

Measured memory_bytes: 888
#include<iostream>
#include<fstream>
#include<sstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<utility>
#include<cctype>
using namespace std;

#define ull unsigned long long
#define stt(it,order) sort(it.begin(),it.end(),order)
#define st(it) sort(it.begin(),it.end())
#define ll long long
#define rep(i,j) for(int i=0;i<j;++i)
#define loop(i,a,j) for(int i=a;i<j;++i)
#define mpi(it,table,T,E) for(map<T,E>::iterator it = table.begin();it!=table.end();++it)
#define PI 3.141592654
/*
ifstream fin("input.txt");
ofstream fout("output.txt");
#define cin fin
#define cout fout
*/


int main(){
   vector<string> data;
   string line;
   cin>>line;
   data.push_back(line);
   int n;
   cin>>n;
   rep(i,n){
      cin>>line;
      data.push_back(line);
   }
   int t = 0;
   loop(i,1,n+1){
      rep(j,10){
         if( data[i].find(data[0]) != string::npos ){
            t++;
            break;
         }
         data[i] += data[i][0];
         data[i].erase(0,1);
      }
   }
   printf("%d\n",t);
   return 0;
}

Measured memory_bytes: 1244
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 競プロ_Csharp {
    class Program {
        static void Main(string[] args) {

            int[] a = NextInts();
            
            if (a[0] < a[1] && a[1] < a[2]) {
                Println("Yes");
            }
            else {
                Println("No");
            }

        }

        public static void Println (Object o) {
            Console.WriteLine(o);
        }

        public static string NextString() {
            return Console.ReadLine();
        }

        public static int NextInt () {
            return int.Parse(Console.ReadLine());
        }

        public static int[] NextInts () {
            string[] a = Console.ReadLine().Split();
            int[] b = new int[a.Length];
            for (int i = 0; i < a.Length; i++) {
                b[i] = int.Parse(a[i]);
            }
            return b;
        }
    }
}



Measured memory_bytes: 15984
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
using ll = long long;

int main(){
  ll a,b,n;
  cin >> a >> b >> n;
  //floor(A(x%B)/B)max=whenx%B==B-1;
  if(n<b-1)cout << floor(a*n/b)-a*floor(n/b) <<endl;
  else cout << floor(a*(b-1)/b)-a*floor((b-1)/b) << endl;
  return 0;
}


Measured memory_bytes: 3704
#include<bits/stdc++.h>
// #include <boost/lexical_cast.hpp>
using namespace std;


#define ll long long int
#define vll vector<ll>
#define vllv vector<vector<ll>> 
#define sz size()
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

ll ceil1(ll n,ll m){if(n%m==0){return n/m;}return n/m +1;}
vll factor(ll n){
    vll ans;
    if(n>0)ans.pb(1);if(n==2)ans.pb(2);
    for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
    return ans;
}
ll fact(ll n){
	
    ll res = 1; 
    for (ll i = 2; i <= n; i++) 
        res = res * i; 
    return res; 
} 
  
int nCr(ll n, ll r) 
{ 
    return fact(n) / (fact(r) * fact(n - r)); 
} 
  
void dfs(vllv &v,ll k,vll &par,vll &dis,ll p)
{
 
    par[k]=p;
    dis[k]=dis[p]+1;
    for(ll i=0;i<v[k].sz;i++){
        if(v[k][i]!=p){
            dfs(v,v[k][i],par,dis,k);
        }
    }
}
bool sortbysec(const pair<string,int> &a,const pair<string,int> &b){return (a.second<b.second);} 


ll ston(string s) 
{ 
    stringstream geek(s); 
    ll x = 0; 
    geek >> x; 
    
  
    return x; 
}
ll pow2(ll n,ll k){ll ans=1;
    while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;}
bool prime(int n){
    int i,j;
    for(i=2;i<=sqrt(n);i++){
        if(n%i==0){
            return false;
        }
    }
    return true;
}
bool bserch(vector<string> a, string s){
	
	ll l=0,r=a.sz-1,mid;
	while(l<=r){
		mid=(l+r)/2;
		if(a[mid]==s)return true;
		if(a[mid]<s){
			l=mid+1;
		}else{
			r=mid-1;
		}
	}
	return false;
}

bool sortcol( const vector<int>& v1, 
               const vector<int>& v2 ) { 
 return v1[0] < v2[0]; 
} 

 ll degit(ll n)
 {
 	ll t=0;
 	while(n>0)
 	{
 		t++;
 		n/=10; 	}
 		return t;
 }
 

void solve()
{
	string s1,s2,s3;
	cin>>s1>>s2>>s3;
	cout<<(char)(s1[0]-('a'-'A'))<<(char)(s2[0]-('a'-'A'))<<(char)(s3[0]-('a'-'A'));
	
	return;	
}
	

int main()
{
	fast;
    ll q;
    q=1;
    // cin>>q;
    while(q--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Collections.Generic;

namespace AOJ2
{
    class Program
    {

        static void Main(string[] args)
        {
            List<decimal> resultList = new List<decimal>();

            while (true)
            {
                decimal q = decimal.Parse(Console.ReadLine());
                if (q == -1)
                {
                    break;
                }

                decimal x = q / 2;
                while (Math.Abs(x * x * x - q) >= (decimal)0.00001 * q)
                {
                    x = Zenka(x, q);
                }

                resultList.Add(x);

            }

            foreach (decimal d in resultList)
            {
                Console.WriteLine(d);
            }

        }

        static decimal Zenka(decimal d,decimal q)
        {
            return d - (d * d * d - q) / (3 * d * d);
        }
        
    }
}

Measured memory_bytes: 5920
#include <stdio.h>

int main(void) {

  long h,w;
  scanf("%ld %ld", &h, &w);
  char s[h][w+1];
  for (long i = 0; i < h; i++) {
    scanf("%s", s[i]);
  }
  long visited[h*w],queue[h*w];
  for (long i = 0; i < h*w; i++) {
    visited[i] = 0;
    queue[i] = -1;
  }
  visited[0] = 1;
  queue[0] = 0;
  long head = 0, tail = 0, start = 0, end = 0, cur, flag;
  long ans = 0;
  long black = 0, white = 0;
  if (s[0][0] == '#') {
    black++;
  } else {
    white++;
  }
  while (1) {
    flag = 0;
    for (long i = start; i <= end; i++) {
      cur = queue[i];
      if (cur%w != 0 && visited[cur-1] == 0 && s[cur/w][cur%w] != s[cur/w][cur%w-1]) {
        if (s[cur/w][cur%w-1] == '#') {
          black++;
        } else {
          white++;
        }
        visited[cur-1] = 1;
        tail++;
        queue[tail] = cur-1;
        flag = 1;
      }
      if (cur%w != w-1 && visited[cur+1] == 0 && s[cur/w][cur%w] != s[cur/w][cur%w+1]) {
        if (s[cur/w][cur%w+1] == '#') {
          black++;
        } else {
          white++;
        }
        visited[cur+1] = 1;
        tail++;
        queue[tail] = cur+1;
        flag = 1;
      }
      if (cur/w != 0 && visited[cur-w] == 0 && s[cur/w][cur%w] != s[cur/w-1][cur%w]) {
        if (s[cur/w-1][cur%w] == '#') {
          black++;
        } else {
          white++;
        }
        visited[cur-w] = 1;
        tail++;
        queue[tail] = cur-w;
        flag = 1;
      }
      if (cur/w != h-1 && visited[cur+w] == 0 && s[cur/w][cur%w] != s[cur/w+1][cur%w]) {
        if (s[cur/w+1][cur%w] == '#') {
          black++;
        } else {
          white++;
        }
        visited[cur+w] = 1;
        tail++;
        queue[tail] = cur+w;
        flag = 1;
      }
    }
    if (flag == 0) {
      ans += black*white;
      if (tail == h*w-1) {
        break;
      } else {
        black = 0;
        white = 0;
        for (long i = head+1; i < h*w; i++) {
          if (visited[i] == 0) {
            visited[i] = 1;
            head = i;
            break;
          }
        }
        tail++;
        queue[tail] = head;
        if (s[head/w][head%w] == '#') {
          black++;
        } else {
          white++;
        }
        start = tail;
        end = tail;
      }
    } else {
      start = end+1;
      end = tail;
    }
  }
  printf("%ld\n", ans);

  return 0;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

int main() {
  int H, W, K; cin >> H >> W >> K;
  vector<string> s(H);
  rep(i, H) cin >> s[i];
  vector<vector<int>> G(H, vector<int>(W, 0));
  auto paint_yoko = [&](int i, int j, int col) {
    queue<int> q;
    q.push(j);
    while(!q.empty()) {
      auto nj = q.front(); q.pop();
      if (s[i][nj] == '#') continue;
      if (G[i][nj]) continue;
      G[i][nj] = col;
      if (nj <= j && nj > 0) q.push(nj - 1);
      if (j <= nj && nj < W - 1) q.push(nj + 1);
    }
  };
  int next_color = 1;
  rep(i, H) rep(j, W) {
    if (s[i][j] == '#') {
      s[i][j] = '.';
      paint_yoko(i, j, next_color++);
    }
  }
  REP(i, 1, H) rep(j, W) {
    if (G[i - 1][j] && !G[i][j]) G[i][j] = G[i - 1][j];
  }
  for (int i = H - 2; i >= 0; --i) rep(j, W) {
    if (G[i + 1][j] && !G[i][j]) G[i][j] = G[i + 1][j];
  }

  rep(i, H) {
    rep(j, W) {
      if (j) cout << " ";
      cout << G[i][j];
    }
    cout << "\n";
  }
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>

using namespace std;

typedef long long int LL;
typedef LL ll;
typedef string str;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef stringstream strs;

#define X first
#define Y second
#define PB push_back
#define For(i,a,b) for (int i=a;i<b;i++)
#define Ford(i,a,b) for (int i=a;i>=b;i--)
#define smax(a,b) a=max(a,b)
#define smin(a,b) a=min(a,b)
#define SZ(a) ((ll)a.size())
#define ER(a) cout << #a << ' ' << a << endl
#define LB(a,n,x) (lower_bound(a,(a)+(n),x)-(a))

const ll M=3e5+5,LG=26,SM=600,inf=1e9+1;
ll mod=95542721;

ll a[M];
ll n,s;

int main()
{
	ios::sync_with_stdio(0);
    cin >> s >> n;
    if (s==1)
    {
        cout <<"1\n1\n1";
        return 0;
    }
    For(i,0,n) cin >> a[i];
    if (n==1)
    {
        cout << a[0] << "\n2\n" << a[0]-1 << " 1";
        return 0;
    } 
    For(i,1,n-1)
    {
        if (a[i]%2)
        {
            if (a[0]%2)
            {
                if (a[n-1]%2)
                {
                    cout << "Impossible";
                    return 0;
                }
                else
                    swap(a[i],a[n-1]);
            }
            else
                swap(a[i],a[0]);
        }
    }  	
    For(i,0,n)
    {
        cout << a[i] << ' ';
    }
    a[n-1]--;
    a[0]++;
    if (a[n-1]==0)
        n--;
    cout << '\n' << n << '\n';
    For(i,0,n)
    {
        cout << a[i] << ' ';
    }      
}

Measured memory_bytes: 256
r, c = map(int,input().split())

table = list()
for i in range(r):
    line = list(map(int,input().split()))
    table.append(line)

col_sum_list = [0 for i in range(len(table[0]))]
for line in table:
    line_sum = 0
    for i in range(len(line)):
        line_sum += line[i]
        col_sum_list[i] += line[i]
    line.append(line_sum)
col_sum_list.append(sum(col_sum_list))

for line in table:
    line = [str(i) for i in line]
    print(' '.join(line))

col_sum_list = [str(i) for i in col_sum_list]
print(' '.join(col_sum_list))



Measured memory_bytes: 5700
N, T = map(int, input().split())
A = list(map(int, input().split()))
Max = [0] * N
revenue = 0
for i in range(N)[::-1]:
    if i == N-1:
        Max[i] = (A[i], 1)
        continue
    ma, cnt = Max[i+1]
    if ma > A[i]:
        Max[i] = Max[i+1]
    elif ma == A[i]:
        Max[i] = (ma, cnt + 1)
    else:
        Max[i] = (A[i], 1)
    revenue = max(revenue, Max[i][0] - A[i])

D = dict()

for a, (m, c) in zip(A, Max):
    if m - a == revenue:
        if (m, a) in D:
            x, y = D[(m, a)]
            D[(m, a)] = (x + 1, max(y, c))
        else:
            D[(m, a)] = (1, c)

ans = 0
for key, value in D.items():
    x, y = value
    ans += min(x, y)
print(ans)


Measured memory_bytes: 93248
import java.util.Scanner;
class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        if(a < b) {
            System.out.println("a < b");
        } else if(a > b) {
            System.out.println("a > b");
        } else {
            System.out.println("a == b");
        }
        sc.close();
    }
}


Measured memory_bytes: 26252
main(a,b,c,p,q,r,s,i,j){for(;scanf("%d%d%d",&a,&b,&c),a;){
if(!c)a==1&&b<0?printf("1 0 %d %d\n",a,b):printf("%d %d 1 0\n",a,b);
else{
	for(r=1;r*r<=a;r++)if(a%r==0)for(p=a/r,s=1;s*s<=abs(c);s++)if(c%s==0)for(j=0;j<2;j++,s=c/s)for(i=0;i<2;i++,s=-s)if(q=c/s,p*s+q*r==b)
		{p==r&&q<s?printf("%d %d %d %d\n",r,s,p,q):printf("%d %d %d %d\n",p,q,r,s);goto next;}
	puts("Impossible");
}next:;}exit(0);}

Measured memory_bytes: 612
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String[] sp = S.split("");
        Deque<String> deque = new ArrayDeque<>();
        for(String s : sp) {
            if(s.equals("0") || s.equals("1")) deque.push(s);
            else {
                if(deque.size() != 0) deque.pop();
            }
        }
        StringBuilder ans = new StringBuilder();
        for(String a : deque) {
            ans.insert(0, a);
        }
        System.out.println(ans);
    }
    
}

Measured memory_bytes: 23124
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define mod 1000000007
#define MAX 1000000000000000
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revrep(i,a,b) for(i=(ll)a;i>=(ll)b;i--)
#define ii pair<ll,ll>
#define MP make_pair
#define pb push_back
#define f first
#define se second
#define ll long long int
#define vi vector<ll>
ll modexp(ll a,ll b){ ll res = 1; while(b > 0){  if(b & 1) res = (res * a)%mod;  a = (a * a)%mod;  b/=2;  }  return res; }
#define rs resize
typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

const ll N = 100009;
ll n;
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>n;
    if(n < 1200) cout<<"ABC";
    else{
        if(n < 2800) cout<<"ARC";
        else
            cout<<"AGC";
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  vector<string> s(3);
  cin >> s[0] >> s[1] >> s[2];

  ll turn = 0;
  while (1) {
    if (s[turn].size() == 0) {
      cout << (char)('A' + turn) << endl;
      return 0;
    }
    char c = s[turn][0];
    s[turn].erase(s[turn].begin());
    turn = c - 'a';
  }
}

Measured memory_bytes: 256
from collections import Counter

N, K, Q = list(map(int, input().split()))
if K > Q:
    [print('Yes') for _ in range(N)]
else:
    c = Counter([int(input()) for _ in range(Q)])
    [print('Yes' if K + c[i+1] - Q > 0 else 'No') for i in range(N)]


Measured memory_bytes: 11512
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    int a, b;
    cin >> a >> b;
    int ans = max(a+b, max(2*a-1, 2*b-1));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
h, w = gets.chomp.split(' ').map(&:to_i)
n = gets.chomp.to_i
a = gets.chomp.split(' ').map(&:to_i)
total = []

a.each_with_index do |num, index|
  num.times do
    total.push (index + 1).to_s
  end
end

h.times do |index|
  if index % 2 == 0
    print total.shift(w).join(' ')
    print "\n"
  else
    print total.shift(w).reverse.join(' ')
    print "\n"
  end
end

Measured memory_bytes: 2556
#include <bits/stdc++.h>

void input ();
void solve ();

const int MAXN = 3e3 + 1;

long long n, t;
std::pair <long long, long long> arr [MAXN];
long long dp [MAXN][MAXN];

long long f (long long x, long long r) {
  if (x >= n || r < 1)
    return dp [x][r] = 0;
  if (dp [x][r] != -1)
    return dp [x][r];


  return dp [x][r] = std::max (f (x + 1, r), f (x + 1, r - arr [x].first) + arr [x].second);
}

void input () {
  scanf ("%lld%lld", &n, &t);
  for (long long i = 0, a, b; i < n; i++) {
    scanf ("%lld%lld", &a, &b);
    arr [i] = std::make_pair (a, b);
  }

  memset (dp, -1, sizeof dp);

  solve ();
}

void solve () {
  std::sort (arr, arr + n);
  printf ("%lld\n", f (0, t));
}

int main () {
  input ();
  return 0;
}


Measured memory_bytes: 70784
#include<iostream>

using namespace std;

int main()
{
	int ans,b,r,g,c,s,t,i,j;
	
	for(;;)
	{
		cin >> b >> r >> g >> c >> s >> t;
		if(t==0)
			break;
		
		ans=100;
		
		ans+=(b*6+r*4)*15+g*7+c*2+s*3;
		ans-=t*3-b*5-r*3;
		
		
		cout << ans << endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>

using namespace std;

int main() {
    vector<int> T(5);
    int min_T = 999;
    int ans = 0;
    for(int i = 0; i < 5; i++) {
        cin >> T[i];
        if(T[i]%10 != 0) {
            if(T[i]%10 <= min_T%10) min_T = T[i];
        }
        ans += ((T[i]+9) / 10) * 10 ;
    }
    if(min_T != 999) ans -= 10 - min_T%10;

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, c = 0;
  cin >> n;
  int p[n];
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  for (int i = 1; i < n - 1 ; i++) {
    if (p[i - 1] < p[i] && p[i] < p[i + 1]) {
      c++;
    } else if (p[i - 1] > p[i] && p[i] > p[i + 1]) {
      c++;
    }
  }
  cout << c << endl;
}

Measured memory_bytes: 256
### subroutines

def root(ids, id)
  id0 = id
  while ids[id0] != id0
    id0 = ids[id0]
  end
  ids[id] = id0
end

### main

loop do
  n, p0, p1 = gets.split.map(&:to_i)
  break if (n | p0 | p1) == 0
  #p [n, p0, p1]

  pp = p0 + p1
  ids = (0...pp).to_a
  edges = pp.times.map{[]}
  nbrs = pp.times.map{[]}

  n.times do
    xi, yi, ai = gets.strip.split
    xi = xi.to_i - 1
    yi = yi.to_i - 1
    ai = (ai == "yes")

    idx = root(ids, xi)
    idy = root(ids, yi)
    if idx != idy
      ids[idy] = idx
      edges[xi][yi] = edges[yi][xi] = ai
      nbrs[xi] << yi
      nbrs[yi] << xi
    end
  end
  #p ["ids", ids]
  #p ["edges", edges]
  #p ["nbrs", nbrs]

  gids = []
  grps = []
  gn = 0

  for i in (0...pp)
    id = root(ids, i)
    if gids[id].nil?
      gids[id] = gn
      gn += 1
    end
    gid =gids[id]
    grps[gid] = [] if grps[gid].nil?
    grps[gid] << i
  end
  #p grps

  gnts = gn.times.map{[]}
  gtids = gn.times.map{[]}
  
  for gid in (0...gn)
    for tf in [true, false]
      used = gids.map{false}
      vals = gids.map{false}
      st = grps[gid].first
      used[st] = true
      vals[st] = tf
      nt = 0
      tids = []
      if tf
        nt += 1
        tids << st
      end
      q = [st]

      while ! q.empty?
        u = q.shift
        uv = vals[u]
        for v in nbrs[u]
          if ! used[v]
            used[v] = true
            vv = edges[u][v] ? uv : ! uv
            vals[v] = vv
            if vv
              nt += 1
              tids << v
            end
            q << v
          end
        end
      end
      gnts[gid] << nt
      gtids[gid] << tids
    end
  end
  #p gnts
  #p gtids

  dp = (gn + 1).times.map{(p0 + 1).times.map{0}}
  dp[0][0] = 1
  dpids = (gn + 1).times.map{(p0 + 1).times.map{[]}}
  
  for gid in (0...gn)
    ngid = gid + 1
    for t in (0..1)
      gnt = gnts[gid][t]
      gtid = gtids[gid][t]
      for pn0 in (gnt..p0)
        if dp[gid][pn0 - gnt] > 0
          dp[ngid][pn0] += dp[gid][pn0 - gnt]
          dpids[ngid][pn0] = dpids[gid][pn0 - gnt] + gtid
        end
      end
    end
  end

  if dp[gn][p0] != 1
    puts 'no'
  else
    dpids[gn][p0].sort.each{|i| puts i + 1}
    puts 'end'
  end
end

Measured memory_bytes: 14960
#include <cstdio>
#include <vector>
const int MAXN = 1005;
int A[MAXN][MAXN];
int dex[MAXN];
int P[MAXN];
bool seen[MAXN]{ };
int N;
std::vector<int> cur, nxt;

void init() {
  for (int i = 1; i <= N; ++i) {
    dex[i] = 1;
    seen[i] = false;
  }
}

void push_next(int k) {
  if (dex[k] >= N) return;
  P[k] = A[k][dex[k]];
  if ((k == P[P[k]]) && !seen[k]) {
    nxt.push_back(k);
    seen[k] = seen[P[k]] = true;
  }
}

int solve() {
  for (int i = 1; i <= N; ++i) push_next(i);
  for (auto a: nxt) seen[a] = seen[P[a]] = false;
  cur = std::move(nxt);

  int ret = 0;
  while (!cur.empty()) {
    for (auto a: cur) {
      int b = P[a];
      ++dex[a];
      ++dex[b];
      push_next(a);
      push_next(b);
    }
    for (auto a: nxt) {
      seen[a] = seen[P[a]] = false;
    }
    cur = std::move(nxt);
    ++ret;
  }
  for (int i = 1; i <= N; ++i) {
    if (dex[i] != N) {
      return -1;
    }
  }
  return ret;
}

int main() {
  scanf("%d", &N);
  init();
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j < N; ++j) {
      scanf("%d", &A[i][j]);
    }
  }
  printf("%d\n", solve());
  return 0;
}

Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  vector<int> num(26);
  for (int i=0; i<s.size(); i++) {
    num[s[i] - 'a']++;
  }
  for (int i=0; i<26; i++) {
    if (num[i] > 1) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  map<int, int> Map;
  
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    
    Map[x]++;
  }
  
  int ans = 0;
  for (auto x : Map) {
    if (x.first > x.second) {
      ans += x.second;
    } else {
      ans += x.second - x.first;
    }
  }
  
  cout << ans << endl;


}

Measured memory_bytes: 7984
#include <bits/stdc++.h>

using namespace std;

int main() {
    string s, t;
    cin >> s >> t;
    int len = s.size() - t.size();
    int ans = 100000;
    for (int i = 0; i <= len; i++) {
        int x = 0;
        for (int j = 0; j < t.size(); j++) {
            if (t[j] != s[i + j])x++;
        }
        ans = min(ans, x);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3616
a = []
x = input()
str1 = raw_input()
str2 = raw_input()
count = 0
while True:
    if count>x-1:
        break
    if str1[count] == str2[count]:
        a.append("v")
        count+=1
    else:
        a.append("h")
        count+=2
total = 1
if a[0] == "h":
    total*=6
if a[0] == "v":
    total*=3
for i in range(1, len(a)):
    if a[i] == "v" and a[i-1] == "h":
        total *=1
        total = total%1000000007
    elif a[i] == "h" and a[i-1] == "v":
        total*=2
        total = total%1000000007
    elif a[i] == "v" and a[i-1] == "v":
        total*=2
        total = total%1000000007
    elif a[i] == "h" and a[i-1] == "h":
        total*=3
        total = total%1000000007
print total

Measured memory_bytes: 2696
#include <bits/stdc++.h>
using namespace std;
#define REP(i,b,e) for(int i=(b);i<(e);++i)
#define RREP(i,b,e) for(int i=(b)-1;i>=e;--i)
#define rep(i,e) for(int i=0;i<(e);++i)

constexpr int MOD = 1000000007;
constexpr int INF = 1LL << 30;
constexpr long long LLINF = 1LL << 62;
constexpr double EPS = 1e-9;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
  }
} initializer;

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    if (it != vec.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}

template<typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &pa) {
  return os << "(" << pa.first << ", " << pa.second << ")";
}

template<typename Tuple, size_t N>
struct TuplePrinter {
  static void print(const Tuple &t) {
    TuplePrinter<Tuple, N-1>::print(t);
    cout << ", " << get<N-1>(t);
  }
};

template<typename Tuple>
struct TuplePrinter<Tuple, 1> {
  static void print(const Tuple &t) {
    cout << get<0>(t);
  }
};

template<typename... T>
ostream &operator<<(ostream &os, const tuple<T...> &tup) {
  os << "(";
  TuplePrinter<decltype(tup), sizeof...(T)>::print(tup);
  return os << ")";
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> &se) {
  os << "{";
  for (auto it = se.begin(); it != se.end(); ++it) {
    if (it != se.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}

template<typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &ma) {
  os << "{";
  for (auto it = ma.begin(); it != ma.end(); ++it) {
    if (it != ma.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  return os << "}";
}

inline void print(void) { cout<<'\n'; }
template<class T> inline void print(const T &x) { cout<<x<<'\n'; }
template<class T, class... U> inline void print(const T &x, const U&... y) { cout<<x<<" "; print(y...); }


int main() {
  int n; cin>>n;
  vector<int> a(n);
  rep(i, n) cin>>a[i];
  int q; cin>>q;

  vector<long long> s(100010, 0);
  long long sum = 0;
  rep(i, n) {
    sum += a[i];
    s[a[i]]++;
  }
  rep(i, q) {
    int b, c; cin>>b>>c;
    long long am = s[b];
    long long diff = am * (c-b);
    sum += diff;
    print(sum);
    s[b] = 0;
    s[c] += am;
  }

  return 0;
}

Measured memory_bytes: 4516
#include<stdio.h>
#include<string.h> 
int dx[4]={0,-1,0,1},dy[4]={1,0,-1,0};
char arr[105][105];
int vis[105][105];
int h,w;
void dfs(char obj,int x,int y)
{	
	int i,nx,ny;
	if(arr[x][y]==obj)
	{
		vis[x][y]=1;
		for(i=0;i<4;i++)
		{
			nx=x+dx[i];
			ny=y+dy[i];
			if(!vis[nx][ny]&&(nx>=0&&nx<h)&&(ny>=0&&ny<w))
				dfs(obj,nx,ny);		
		}
	}
	else
		return;
}
int main() 
{
	while(scanf("%d%d",&h,&w),h||w)
	{
		int i,j,num=0;
		for(i=0;i<h;i++)
			scanf("%s",arr[i]);
		for(i=0;i<h;i++)
		for(j=0;j<w;j++)
		{
			if(vis[i][j])
				continue;
			else
			{
				dfs(arr[i][j],i,j);
				num++;
			}
		}
		printf("%d\n",num);
		memset(arr,'\0',sizeof(arr));
		memset(vis,0,sizeof(vis));
	} 
	return 0; 
} 


Measured memory_bytes: 3116
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
typedef long long ll;
long long MOD = 1e9 + 7;
const long long INF = 1LL << 60;
using namespace std;

template <class T>
inline bool chmin(T &a, T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T &a, T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}

int main()
{
  string s;
  string bef = "";
  string af = "";
  cin >> s;
  int q;
  cin >> q;

  int state = 0; // 0 普通, 1 逆転

  rep(i, q)
  {
    int t, f;
    string c;
    
    cin >> t;
    if (t == 1)
    {
      state = 1 - state;
    }
    if (t == 2)
    {
      cin >> f >> c;
      if (state == 0)
      {
        if(f == 1) {
          bef = c + bef;
        } else {
          af = af + c;
        }
      } else {
        if (f == 1)
        {
          af = af + c;
          
        }
        else
        {
          bef = c + bef;
        }
      }
    }
  }

  if(state == 0) {
    cout << bef + s + af << endl;
  } else {
    string rev = bef + s + af;
    reverse(rev.begin(), rev.end());
    cout << rev << endl;
  }
  return 0;
}

Measured memory_bytes: 1512
#include<iostream>
#include<iomanip>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
#include<memory>
using namespace std;
using ll=long long;

int main(){
    int n;
    cin>>n;
    vector<int> d(n);
    vector<ll> c(n);
    for(int i=0;i<n;i++) cin>>d[i]>>c[i];

    ll sum=0;
    ll csum=0;
    for(int i=0;i<n;i++){
        sum+=d[i]*c[i];
        csum+=c[i];
    }

    cout<<csum+(sum-1)/9-1<<endl;

    
    
    
    return 0;
}


Measured memory_bytes: 2560
import java.util.Arrays;
import java.util.Scanner;

class Problem {
    private int N;
    private int[] A;

    Problem() {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }
    }

    int solve() {
        Arrays.sort(A);
        while (A[0] > 1) {
            int minMod = A[0];
            int minPos = 0;

            for (int i = 1; i < N; i++) {
                int m = A[i] % A[0];
                if (m > 0 && m < minMod) {
                    minMod = m;
                    minPos = i;
                }
            }

            if (minPos == 0) break;

            A[minPos] = A[0];
            A[0] = minMod;
        }

        return A[0];
    }
}

public class Main {
    public static void main(String[] args) {
        System.out.println(new Problem().solve());
    }
}


Measured memory_bytes: 50124
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    void solve() {
        int N = in.nextInt();
        int K = in.nextInt();
        int result = 0;
        for (int i = 0; i < N ; i++) {
            int x = in.nextInt();
            result += Math.min(x, Math.abs(K - x))*2;
        }
        out.println(result);

    }


    FastScanner in;
    PrintWriter out;

    void run() {
        in = new FastScanner();
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }

    public class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }

    public static void main(String[] args) {
        new Main().run();
    }

}

Measured memory_bytes: 22996
#include <iostream>
using namespace std;
int main(void){
    int n;
    cin >> n;
    
    int a[100001] = {0};
    int sum = 0;
    int i;
    for(i = 1; i <= n; i++){
        cin >> a[i];
        sum += abs(a[i] - a[i - 1]);
    }
    sum += abs(a[n]);
    
    for(i = 1; i <= n; i++){
        if(a[i - 1] < a[i] && a[i + 1] < a[i]){
            cout << sum - (a[i] - max(a[i - 1], a[i + 1])) * 2 << endl;
        }else if(a[i - 1] > a[i] && a[i + 1] > a[i]){
            cout << sum - (min(a[i - 1], a[i + 1]) - a[i]) * 2 << endl;
        }else{
            cout << sum << endl;
        }
    }
    
    return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()

int main(void){
  ll n,m,a,b,c,d;
  vector<int> v,v2;
  string s;
  int ans = 0;

  cin>>n>>m>>a;
  cout<<a/n*m<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y << endl;


}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <map> 
#include <set>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define skip(i,n,p) for(int i=0;i<n;i+=p)
#define ll long long

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    cout.precision(20);
    cout << fixed;

    int n;
    cin >> n;

    int l[n][2];
    rep(i, n) cin >> l[i][0] >> l[i][1];

    int a = 0;
    rep(i, n) {
        a = max(a, l[i][0]);
        a = max(a, l[i][1]);
    }

    bool prime[a+1];
    rep(i, a+1) prime[i] = true;
    prime[0] = false;
    prime[1] = false;
    rep(i, a+1) {
        if (!prime[i]) continue;
        skip(j, a+1, i) {
            if(j > i) prime[j] = false;
        }
    }

    bool b[a+1];
    rep(i, a+1) b[i] = false;
    rep(i, a+1) {
        if(prime[i] && prime[(i+1)/2]) {
            b[i] = true;
        }
    }

    int aa[a+2];
    aa[0] = 0;
    rep(i, a+1) aa[i+1] = aa[i] + b[i];

    rep(i, n) {
        cout << aa[l[i][1]+1] - aa[l[i][0]] << endl;
    }
}


Measured memory_bytes: 2048
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int X,A;
    scanf("%d%d",&X,&A);
    if(X>=0&&X<=9&&A>=0&&A<=9)
    {
        if(X<A)
            printf("0");
        else
            printf("10");
    }
}


Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int x;
  cin >> x;
  if (x >= 30) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3580
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int n = Integer.parseInt(W);

		W = in.readLine();
		String[] D = W.split(" ");

		long[] m = new long[n];
		Arrays.fill(m, 0);

		long[] a = new long[n];
		long sum = 0;
		for(int i=0;i<D.length;i++){
			a[i] = Long.parseLong(D[i]);
			sum+=a[i];
		}

		m[0] = sum;
		for(int i = 1;i<n;i=i+2){
			m[0] -= 2*a[i];
		}

		for(int i = 1 ; i<n ;i++){
			m[i] = 2*a[i-1] - m[i-1];
		}


		StringBuffer sb = new StringBuffer();
		for(int i=0;i<m.length;i++){
			sb.append(String.valueOf(m[i]));
			if(i!=m.length-1){
				sb.append(" ");
			}
		}

		System.out.println(sb.toString());

	}


}


Measured memory_bytes: 50844
n, m = map(int, input().split())
lst = [x for x in range(n)]
dic = {}
not_found = False
special_case = False
for i in range(m):
    a, b = map(int, input().split())
    if str(a) not in list(dic.keys()):
        dic[str(a)] = b
    else:
        if dic[str(a)] != b:
            not_found = True
    lst[a - 1] = b
if m == 0:
    special_case = True
if not_found:
    print(-1)
elif special_case:
    if n == 1:
        print(0)
    elif n == 2:
        print(10)
    else:
        print(100)
else:
    for i in range(n):
        if str(i + 1) not in list(dic.keys()):
            if i + 1 == 1:
                lst[i] = 1
            else:
                lst[i] = 0
    lst = list(map(str, lst))
    res = ''.join(lst)
    if res[0] == '0' and len(res) > 1:
        print(-1)
    else:
        print(int(res))


Measured memory_bytes: 3064
//package AtCoder;
import java.io.*;
import java.util.*;

public class Main {
	static char[]s,t;
	static int dp[][];
	static int dp(int i,int j)
	{
		if(i == s.length || j == t.length)
			return 0;
		
		if(dp[i][j]!=-1)
			return dp[i][j];
		
		int take=-1;
		for(int k=j;k<t.length;k++)
			if(s[i]==t[k])
			{
				take=k;
				break;
			}
		if(take!=-1)
			take=1+dp(i+1,take+1);
		else 
			take=0;
		int leave = dp(i+1,j);
		return dp[i][j] = Math.max(leave, take);
	}
	static int dp(int i,int j,String s1)
	{
		if(i == s.length || j == t.length)
		{
			System.out.println(s1);
			return 0;
		}
		
		if(dp[i][j]!=-1)
			return dp[i][j];
		
		int take=-1;
		for(int k=j;k<t.length;k++)
			if(s[i]==t[k])
			{
				take=k;
				break;
			}
		if(take!=-1)
			take=1+dp(i+1,take+1,s1+s[i]);
		else 
			take=0;
		int leave = dp(i+1,j,s1);
		return dp[i][j] = Math.max(leave, take);
	}
	static void print(int i,int j)
	{
		if(i == s.length || j == t.length)
			return ;
		int ans=dp(i,j);
		int take=-1;
		int k;
		for(k=j;k<t.length;k++)
			if(s[i] == t[k])
			{
				take=k;
				break;
			}
		if(take!=-1)
			take=1+dp(i+1,k+1);

		if(take == ans )
		{
			sb.append(s[i]);
			print(i+1,k+1);
		}
		else
			print(i+1,j);
	}
	static StringBuilder sb = new StringBuilder();
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter pw = new PrintWriter(System.out);
		s=sc.nextCharArray();
		t=sc.nextCharArray();
		dp=new int[s.length][t.length];
		for(int i=0;i<s.length;i++)
			Arrays.fill(dp[i], -1);
		
		dp(0,0);
		print(0,0);
		System.out.println(sb);
		pw.close();
	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		boolean hasnext() throws IOException {
			return br.ready();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public Integer[] nextIntegerArray(int n) throws IOException {
			Integer[] a = new Integer[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		char[] nextCharArray() throws IOException {
			return br.readLine().toCharArray();
		}

		public double[] nextDoubleArray(int n) throws IOException {
			double[] ans = new double[n];
			for (int i = 0; i < n; i++)
				ans[i] = nextDouble();
			return ans;
		}

	}
}


Measured memory_bytes: 81072