akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



signed main(){
cin.tie(0);
ios::sync_with_stdio(false);

	int N,ans=0;
	cin >> N;
	vector<string> S(N);
	REP(i, N)cin >> S[i];

	REP(i, N) {

		bool F = true;

		REP(j, N) {
			FOR(k, j, N) {
				int a = (i + j) % N;
				int b = (i + k) % N;

				if (S[j][b] != S[k][a])F = false;

			}
		}
		if (F) {
			ans++;
			//cout << i << endl;
		}
	}



	cout << ans*N << endl;

	return 0;
}



Measured memory_bytes: 512
N, K = map(int, input().split())
ans = 0
mod = 10 ** 9 + 7
count = [0] * (K+10)
for i in range(K,0,-1):
    t = pow(K//i, N, mod)
    j = 2
    while j * i <= K:
        t -= count[j*i]
        j += 1
    count[i] = t
    # tがiの倍数からなる数列の個数であることが確定しているはず
    ans += t * i
    ans %= mod

print(ans)


Measured memory_bytes: 68688
d, n = map(int, input().split())
l = []
if 1<=n<=99:
    l.append(str(n))
    for i in range(d):
        l.append("00")
    print("".join(l))
    exit()
else:
    l.append("101")
    for i in range(d):
        l.append("00")
    print("".join(l))
    exit()

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

int N;
int ret;
vector<int> tgt, l;
void dfs(int i, vector<int>& v1, vector<int>& v2, vector<int>& v3, vector<int>& v4) {
  if (i == N) {
    int cost = 0, a = 0, b = 0, c = 0;
    for (auto vv : v1) {
      a += vv;
      cost += 10;
    }
    for (auto vv : v2) {
      b += vv;
      cost += 10;
    }
    for (auto vv : v3) {
      c += vv;
      cost += 10;
    }
    cerr << a << " " << b << " " << c << endl;
    if (v1.size() == 0) return;
    if (v2.size() == 0) return;
    if (v3.size() == 0) return;
    cost -= 30;
  
    cost += abs(tgt[0] - a);
    cost += abs(tgt[1] - b);
    cost += abs(tgt[2] - c);
    ret = min(ret, cost);
    return;
  }
  v1.push_back(l[i]);
  dfs(i + 1, v1, v2, v3, v4);
  v1.pop_back();

  v2.push_back(l[i]);
  dfs(i + 1, v1, v2, v3, v4);
  v2.pop_back();

  v3.push_back(l[i]);
  dfs(i + 1, v1, v2, v3, v4);
  v3.pop_back();

  v4.push_back(l[i]);
  dfs(i + 1, v1, v2, v3, v4);
  v4.pop_back();
}

int main(void) {
  cin >> N;
  ret = 1e9;
  tgt.resize(3);
  l.resize(N);
  cin >> tgt[0] >> tgt[1] >> tgt[2];
  for (int i = 0; i < N; i++) {
    cin >> l[i];
  }
  cerr << 'e' << endl;
  vector<int> v1,v2,v3,v4;
  dfs(0, v1, v2, v3, v4);
  cout << ret << endl;
  return 0;
}

Measured memory_bytes: 256
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <list>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <iterator> 
#include <limits>

#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a); i<(b); i++)
#define ALL(a) (a).begin(),(a).end()
#define RALL(A) (a).rbegin(),(a).rend()
#define PB push_back
#define MP make_pair

#define dump(x) cerr << #x << " = " << (x) << endl;

using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

int N, K;
VI A;

template <typename T>
map<T, int> zaatu (vector<T> arr) {
    int N = arr.size();
    map<T, int> ret;
    vector<T> arr_copy;
    copy(arr.begin(), arr.end(), back_inserter(arr_copy));
    sort(arr_copy.begin(), arr_copy.end());

    int compressed_index = 1;
    for (int i = 0; i < N; i++) {
        T e = arr_copy[i];
        if (i == 0) {
            ret[e] = compressed_index;
        } else {
            if (e != arr_copy[i-1]) {
                compressed_index += 1;
                ret[e] = compressed_index;
            }
        }
    }
    return ret;
}

template <typename T>
struct BIT {
    int N;
    vector<T> bit;

    BIT (int N) {
        this -> N = N;
        for (int i = 0; i <= N; i++) {
            bit.push_back(0);
        }
    }

    /*
     * a_1 + a_2 + ... + a_n
     * O(log n)
     */
    T sum (int n) {
        T ret = 0;
        while (n > 0) {
            ret += bit[n];
            // nの最後の1のビットに対応する数を引く
            // ex) 0110 -> 0100 (= 0110 - 0010)
            n -= n & -n;
        }
        return ret;
    }

    /*
     * a_n += x
     * O(log n)
     */
    void add (int n, T x) {
        while (n <= N) {
            bit[n] += x;
            // nの最後の1のビットに対応する数を足す
            // ex) 0101 -> 0110 (= 0101 + 0001)
            n += n & -n;
        }
    }
};

int main(int argc, char const* argv[])
{
    cin >> N >> K;
    REP(i, N) {
        int a; cin >> a; A.PB(a - K);
    }
    vector<LL> sums;
    sums.PB(0);
    REP(i, N) {
        sums.PB(sums[i] + A[i]);
    }

    map<LL, int> za = zaatu(sums);
    BIT<LL> bit(N + 10);
    LL ans = 0;
    REP(i, N + 1) {
        // cout << i << " " << sums[i] << " " << za[sums[i]] << " " << i - bit.sum(za[sums[i]]) << endl;
        // ans += i - bit.sum(za[sums[i]]);
        ans += bit.sum(za[sums[i]]);
        bit.add(za[sums[i]], 1);
    }
    // cout << (LL)(N + 1) * N / 2 - ans << endl;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 18744
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include<math.h>

int main(){
    long long int H,W;
    scanf("%lld %lld",&H,&W);
    if(H == 1 || W == 1){
        printf("1");
    }else if( (H*W) % 2 == 0){
        printf("%lld",H*W/2);
    }else{
        printf("%lld",H*W/2+1);
    }
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
   
using namespace std;
#define ll long long
#define ld long double
#define pll pair<long long,long long>
#define vll vector<long long>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define deb(x) cout << #x << "=" << x << endl
#define F(i,a,b) for(ll i=a;i<=b;i++)
#define RF(i,a,b) for(ll i=a;i>=b;i--)
#define in(a,n) F(i,0,n-1)cin>>a[i]
#define vi vector<int>
#define out(a,n) F(i,0,n-1)cout<<a[i]<<" ";cout<<endl
#define mod 1000000007
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define int long long
set < ll> primes;
 
int n,m;

bool isvalid(int x,int y)
{
    return (x>=0 && x<n && y>=0 && y<m);
}
int dx[]={0,0,1,-1,-1,1,1,-1};
int dy[]={1,-1,0,0,-1,1,-1,1};
void Sieve(ll n) 
{ 
    bool prime[n+1];
	for(ll i=0;i<n+1;++i)
		prime[i]=true;
    for (ll p=2;p*p<=n;++p) 
    {
        if (prime[p] == true) 
        {  
            for (ll i=2*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    }  
    for(ll p=2; p<=n; p++) 
       if (prime[p]) 
		primes.insert(p);  
}

ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
        return gcd(b % a, a); 
} 
ll powermod(ll x, ll y){
    if(y==0)
    return 1;
        
    if(y%2==0)
    return (powermod(x,y/2)*powermod(x,y/2))%mod;
    else
    return (((powermod(x,y/2)*powermod(x,y/2))%mod)*x)%mod;
}

void solve()
{
  int n;
  cin>>n;
  int a[n];
  for(auto &x:a)cin>>x;
  sort(a,a+n,greater<int>());
  
  int ans=0;
  vector<int>v;
  for(int i=0;i<n;i++)
  {
      v.pb(a[i]);
      if(i)v.pb(a[i]);
  }
  for(int i=0;i<n-1;i++)ans+=v[i];
  cout<<ans;
    
}

 

int32_t main()
{
	ios::sync_with_stdio(false);
    cin.tie(NULL);
    
	int t=1;
//	cin>>t;
	while(t--)solve();
	    
   
}

Measured memory_bytes: 8912
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        
        int in = 0;
        int x5 = 0;
        int x7 = 0;
        
        for(int i = 0 ; i < 3 ; i++){
            in = scan.nextInt();
            if(in == 5){
                x5 = x5 + 1;
            }
            if(in == 7){
                x7 = x7 + 1;
            }
        }
        
        String ans = "NO";
        
        if(x5 == 2){
            if(x7 == 1){
                ans = "YES";
            }
        }

        System.out.println(ans);
        
    }
}

Measured memory_bytes: 20948
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<climits>
#include<cstdlib>
#include<map>
#include<math.h>
#include<utility>
using namespace std;
typedef long long ll;

int main(){
  int n;
  cin >> n;
  ll a[100001];
  for(int i=0; i<n; i++) cin >> a[i];
  sort(a, a+n);
  int ans=0;
  int tmp=1;
  for(int i=1; i<n; i++){
    if(a[i] == a[i-1]){
      tmp++;
    }else{
      if(tmp > a[i-1]) ans += tmp - a[i-1];
      else if(tmp < a[i-1]) ans += tmp;
      tmp = 1;
    }
  }
  if(tmp > a[n-1]) ans += tmp - a[n-1];
  else if(tmp < a[n-1]) ans += tmp;
  cout << ans << endl;
}



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

int main()
{
    int n,m,c,ans=0;
    cin>>n>>m>>c;
    int b[m]={};
    for(int i=0;i<m;i++)
    {
        cin>>b[i];
    }
    for(int i=0;i<n;i++)
    {
        int sum=0;
        for(int j=0;j<m;j++)
        {
            int k;
            cin>>k;
            sum+=k*b[j];
        }
        if(sum+c>0)
            ++ans;
    }
    cout<<ans;
    return 0;
}



Measured memory_bytes: 3588
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <map>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define SUPmaxm 1001
#define SUPmaxw 1001

int maxm;
int maxw;
int vs[SUPmaxm];
int wos[SUPmaxm];
int dp[SUPmaxm][SUPmaxw]; //m ika no item tukatte, w ika no omomi de, sum v no max
int rev,rew;

void solve(){
	rev=0;
	FOR(m,0,maxm+1) FOR(w,0,maxw+1) dp[m][w]=0;
	FOR(m,1,maxm+1){
		FOR(w,0,maxw+1){
			if(w<wos[m]) dp[m][w] = dp[m-1][w];
			else dp[m][w] = max(dp[m-1][w],dp[m-1][w-wos[m]]+vs[m]);
			rev=max(rev,dp[m][w]);
		}
	}
	rew=0;
	FOR(w,0,maxw+1) FOR(m,0,maxm+1) if(dp[m][w]==rev) {rew=w;return;};
}

int main(){
	for(int casei=1;true;++casei){
		scanf("%d",&maxw);			if(!maxw) return 0;
		scanf("%d",&maxm);
		FOR(m,1,maxm+1) scanf("%d,%d",vs+m,wos+m);
		solve();
		printf("Case %d:\n%d\n%d\n",casei,rev,rew);
	}
}

Measured memory_bytes: 5108
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<int,int> P;
#define all(v) (v).begin(),v.end()
#define fi first
#define se second
const ll inf=(1e18);
ll dp[4000][4000];
int main(){
int n;
cin>>n;
vector<ll> a(n);
for(int i=0;i<n;i++)cin>>a[i];
for(int len=1;len<=n;len++){
    for(int i=0;i+len<=n;i++){
        int j=len+i;//[i,j)
        if((n-len)%2==0){//すでに取られた石の数が偶数個なら先手番
             dp[i][j]=max(dp[i+1][j]+a[i],dp[i][j-1]+a[j-1]);//i+1=左端からとる、j-1＝右端からとる
        }
        else{
             dp[i][j]=min(dp[i+1][j]-a[i],dp[i][j-1]-a[j-1]);
        }
    }
}
cout<<dp[0][n]<<endl;
}



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

int main() {
  int N;
  
  cin >> N;
  for(int i=0;i<N;i++){
    string S;
    cin >> S;
    if(S=="Y"){
      cout << "Four" << endl; 
      return 0;
    } 
  }
  cout << "Three" << endl;
  return 0;
}


Measured memory_bytes: 3588
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author rn-sshawish
 */
public class Main{
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int left = input.nextInt() + input.nextInt();
        int right =  input.nextInt() + input.nextInt();
        if (left > right) {
            System.out.println("Left");
        }else if (left < right) {
            System.out.println("Right");
        }else{
            System.out.println("Balanced");
        }
    }
}


Measured memory_bytes: 22228
import collections

def gojo(a, b):
  if a < b:
    return gojo(b, a)
  if a % b > 0:
    return gojo(b, a % b)
  else:
    return b

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

a, b = map(int, input().split())
c = collections.Counter(prime_factorize(gojo(a, b)))
print(len(c) + 1)

Measured memory_bytes: 3444
#include <bits/stdc++.h>
#include <iostream>
using namespace  std;
vector<int>vc;
const int N=1e5+2;
bool p[N];
void prime(){
 
p[0]=false;p[1]=false;
    memset(p,true,sizeof(p));
    for(int i=2;i*i<=N;i++){
        if(p[i]==true){
            for(int j=i*i;j<=N;j+=i)
            {
            p[j]=false;
 
            }
        }
    }
for(int i=2;i<=N;i++){
 
    if(p[i]==true){
 
    vc.push_back(i);
 
}
}
 
 
 
}
 
 
int main() {
 
prime();
//for(auto x: vc)cout<<x;
 
int q;
cin>>q;
for(int i=0;i<q;i++){
 
    int x,y;
    int counter=0;
    cin>>x>>y;
    for(int j=0;j<vc.size();j++){
 
        if(vc[j]%2!=0&&vc[j]>=x && vc[j]<=y && p[(vc[j]+1)/2]==true){ counter++;}
 
    }
    cout<<counter<<endl;
 
 
 
 
}
 
}
 
 
 
 
 
 

Measured memory_bytes: 896
import sys
import numpy as np

I = np.array(sys.stdin.read().split(), dtype=np.int64)
n, ma, mb = I[:3]
abc = I[3:].reshape(n, 3)

def main():
    sa, sb = np.sum(abc, axis=0)[:2]
    res = np.full((sa+1, sb+1), np.inf)
    res[0, 0] = 0

    for a, b, c in abc:
        res[a:, b:] = np.minimum(res[a:, b:], res[:-a, :-b] + c)
    
    ans = np.inf
    for i in range(1, min(sa//ma, sb//mb) + 1):
        ans = np.minimum(ans, res[ma * i, mb * i])
    
    if ans == np.inf:
        return -1
    return int(ans)
    
if __name__ == '__main__':
    ans = main()
    print(ans)

Measured memory_bytes: 13924
#include<bits/stdc++.h>
using namespace std;
int main(){
int s;
  cin>>s;
  int ans;
  set<int>p;
  p.insert(s);
  for(int i=2; ;i++){
  if(s%2==0)
    s/=2;
    else
      s=3*s+1;
    ans=i;
    if(!p.count(s))
      p.insert(s);
    else
      break;
  
  } cout<<ans<<endl;



   return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;
typedef long long ll;
const int MAXN = 110;

struct pos {
  ll x, y, h;
};

bool compare(const pos& lhs, const pos& rhs) {
  return lhs.h > rhs.h;
}

int n;
pos positions[MAXN];

bool check(int cx, int cy, int& h) {
  h = positions[0].h + abs(positions[0].x - cx) + abs(positions[0].y - cy);
  for (int i=1;i<n;i++) {
    if (positions[i].h != max<ll>(h - abs(positions[i].x - cx) - abs(positions[i].y - cy), 0)) {
      return false;
    }
  }
  return true;
}

void solve() {
  sort(positions, positions + n, compare);
  for (int x=0;x<=100;x++) {
    for (int y=0;y<=100;y++) {
      int h;
      if (check(x, y, h)) {
        cout << x << " " << y << " " << h << endl;
        return;
      }
    }
  }
}

int main() {
  cin >> n;
  for (int i=0;i<n;i++) {
    cin >> positions[i].x >> positions[i].y >> positions[i].h;
  }
  solve();
}


Measured memory_bytes: 256
while 1:
    n=int(input())
    if n==0: break
    a=[0]*10
    while n:
        n-=1
        a[int(input())]+=1
    for i in range (10):
        for j in range(a[i]):
             
            print('*',end="")
        if a[i]==0:
            print('-',end="")
        print()


Measured memory_bytes: 7580
#pragma GCC optimize "trapv"
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define ld long double
#define mp make_pair
#define pii pair<int,int>
#define mod 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
#define repp(i,a,n) for(int i=a;i<n;i++)
#define all(v) v.begin(),v.end()
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>//s.order_of_key(val) *s.find_by_order(ind)
int main()
{
    fio;
    int t=1;
    //cin>>t;
    while(t--)
    {
        ll d,t,s;
        cin>>d>>t>>s;
        if(d<=(s*t))
        cout<<"Yes"<<endl;
        else
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3636
def g(a)
  a -= 1
  
  n = 26
  i = 1
  while true
    return a.to_s(26).rjust(i, "0").tr('0-9a-z', 'a-z') if a < n
    a -= n
    n *= 26
    i += 1
  end
end


a = gets.to_i 
puts g(a)
#1.upto(703){|x| p [x, f(x)]}



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

int main(){
	int n;
	long long x, arr[105], total = 0;
	cin >> n >> x;
	for (int i = 1; i <= n; i++){
		cin >> arr[i];
		total = total + arr[i];
	}
	//cout << total << endl;
	sort(arr+1, arr+n+1);
	//for (int i = 1; i <= n; i++){
	//	printf("i = %d, datanya = %lld\n", i, arr[i]);
	//}
	int cnt = 1, sum = 0;
	if (x > total){
		cout << n-1 << endl;
	} else {
		while ((x - arr[cnt]) >= 0){
			sum++;
			x = x - arr[cnt];
			cnt++;
		}
		cout << sum << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <random>
#include <ctime>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
#define ll long long
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define pll pair<ll,ll>
#define ld long double
#define pld pair<ld,ld>
#define pii pair<int,int>
#define sqr(a) ((a)*(a))
#define all(v) v.begin(),v.end()

using namespace std;
//using namespace __gnu_pbds;

const ll MOD = 1e9+7;
const ll INF=1e18;
const ld E=1e-8;
mt19937_64 rnd(time(0));
ll p1 = 31, p2 = 29, p3 = 7, p4=rnd()%100+1, md1 = MOD, md2 = 998244353, md3=998244357, md4=rnd()%1000000000;

//using ord_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

ll n, m, k, h, T;
pii b[300001];

ll binpow(ll h, ll r, ll md = MOD)
{
    ll l = 1;
    while (r)
    {
        if (r & 1) l *= h, l %= md;
        h *= h;
        h %= md;
        r /= 2;
    }
    return l;
}

ll gcd(ll x, ll y)
{
    if (x < y) swap(x, y);
    while (x && y)
    {
        x %= y;
        swap(x, y);
    }
    return x + y;
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //freopen("capitals.in","r",stdin);
    //freopen("capitals.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    cout << n*m;
    return 0;
}

/*
4
1 4 3 6
3
1 2 3
4
6 3 4 1
*/


Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define D(x) cout<<"D: "<<#x<<'='<<x<<endl;
#define R(x, l) cout<<"R: Array "<<#x<<endl; for(int i = 0; i < l; i++) cout<<' '<<i<<':'<<*(x+i)<<endl;
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
template<typename tn> inline tn next(void)
{
	tn k;
	cin>>k;
	return k;
}
template<typename tn> inline ostream& operator << (ostream& os, const vector<tn>& v)
{
	for(unsigned i = 0; i < v.size(); i++) os<<v[i]<<' ';
	return os;
}
ll w[300050], cnt[300050];
int main(void)
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n = next<ll>();
	ll sum = 0;
	for(int i = 0; i < n; i++) cin>>w[i], cnt[w[i]]++;
	for(int i = 1; i < 200050; i++) sum += cnt[i]*(cnt[i]-1)/2;
	for(int i = 0; i < n; i++) cout<<sum-cnt[w[i]]+1<<endl;
	return ~~(0-0);
}

Measured memory_bytes: 5248
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0;i<n;i++)
using ll = long long;
const int MOD = 1e9+7;

int n;
int dp[1000010][2][2]; // [N][0を含むかどうか][9を含むかどうか]

ll modpow(ll x, ll y) {
  ll v = 1;
  REP(i,y) { v *= x; v %= MOD; }
  return v;
}

// 包除原理解法
void solve1() {
  ll p1 = modpow(10, n);
  ll p2 = (modpow(9, n) * 2) % MOD;
  ll p3 = modpow(8, n);
  ll ans = p1 - (p2 - p3);
  ans %= MOD;
  ans = (ans + MOD) % MOD;
  cout << ans << endl;
}

// DP解法
void solve2() {
  dp[0][0][0] = 1;
  REP(i,n) {
    REP(j,2) {
      REP(k,2) {
        REP(x,10) {
          int nj = j | x == 0;
          int nk = k | x == 9;
          dp[i+1][nj][nk] += dp[i][j][k];
          dp[i+1][nj][nk] %= MOD;
        }
      }
    }
  }
  cout << dp[n][1][1] << endl;
}

int main() {
  cin >> n;
  // solve1();
  solve2();
  return 0;
}

Measured memory_bytes: 19008
// https://atcoder.jp/contests/abc057/tasks/abc057_a
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    cout << (a + b) % 24 << endl;
    return 0;
}


Measured memory_bytes: 256
let s = read_line () in
let string_count f s =
  let count = ref 0 in
  String.iter (fun c -> if f c then incr count) s;
  !count in
let n = string_count (fun c -> c = 'o') s in
let rest = 15 - String.length s in
print_endline @@ if n + rest >= 8 then "YES" else "NO"

Measured memory_bytes: 384
#include <stdio.h>

int main(){
    int a,b,c,val;
    
    scanf("%d %d %d",&a,&b,&c);
    
    val=b/a;
    
    if(val>=c){
        printf("%d\n",c);
    }
    
    else{
        printf("%d\n",val);
    }
    
    return 0;
}

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

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	string S;
	cin>>S;
    string ans = "Yes";
    if(S[0]==S[1] &&S[1]==S[2]){
        ans = "No";
    }
    cout<<ans<<"\n";
	
	return 0;
}

Measured memory_bytes: 256
/*input
100 50 4
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}

vector<int> v;
int main()
{
	IOS;
	int a,b,k;
	cin>>a>>b>>k;
	for(int i=1;i<=a&&i<=b;i++){
		if(a%i==0&&b%i==0){
			v.pb(i);
		}
	}
	cout<<v[SZ(v)-k];
	return 0;
}


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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> H;
  for (int i = 0; i < N; i++) {
    int h;
    cin >> h;
    H.emplace_back(h);
  }
  
  sort(H.begin(), H.end(), greater<int>());
  long long ans = 0;
  
  for (int i = K; i < N; i++) ans += H[i];
  
  cout << ans << endl;
  return 0;
}

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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> A(N), B;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    if (i % 2 == 0) B.emplace_back(A[i]);
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  int res = 0;
  for (int i = 1; i < N; i += 2) {
    if (binary_search(B.begin(), B.end(), A[i])) res++;
  }
  cout << res << '\n';
  return 0;
}


Measured memory_bytes: 1024
n = int(input())
p = list(map(int, input().split()))

counter = 0

for i in range(n-2):
  if p[i+1] >= p[i+2]:
    if p[i+1] <= p[i]:
      counter += 1

  else:
    if p[i+1] >= p[i]:
      counter += 1

print(counter)


Measured memory_bytes: 2940
#include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
#include<vector>
using namespace std;
int main(){
  int n;
  vector< int > an(100002);
  long sum=0;
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> an[i];
    int path;
    if( i==0 ) path = an[i];
    else path = an[i] - an[i-1];

    if( path < 0 ) path=-path;

    sum += path;
  }
  if( an[n-1] > 0) sum+= an[n-1];
  else sum -= an[n-1];
  
  for( int i=0; i<n; i++){
    int path1;
    if( i==0 ) path1=an[i];
    else path1 = an[i]-an[i-1];

    if( path1 < 0 ) path1 = -path1;

    int path2;
    if( i==(n-1) ) path2= an[i];
    else path2 = an[i+1] - an[i];
    
    if( path2 < 0 ) path2 =- path2;

    int path3;
    if( i==0 ) path3 = an[i+1];
    else if( i==(n-1) ) path3 = an[i-1];
    else path3 = an[i+1] - an[i-1];
    
    if( path3 < 0 ) path3 =- path3;

    long tmp = path3 - path1 - path2;
    printf("%ld\n", sum+tmp);
  }
  return 0;
  
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll M = 1e9 + 7;
const int iinf = 1 << 29;
const long long llinf = 1ll << 60;
const double PI = 3.14159265;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll mrand(ll B) {
  return (ull)rng() % B;
}

const int mxn = 1e7+1;
ll s[mxn];

void work() {
    int n; cin>>n;
    for (int i = 1; i <= n; ++i) s[i] = 1;
    for (ll i = 2; i <= n; ++i) {
        if (s[i] == 1) {
            s[i] = 2;
            for (int j = i + i; j <= n; j += i) {
                ll c = j;
                int nd = 1;
                while (c%i == 0) {
                    ++nd;
                    c /= i;
                }
                s[j] *= nd;
            }
        }
    }
    ll ans = 0;
    for (ll i = 1; i <= n; ++i)
        ans += i * s[i];
    cout << ans << "\n";

    /*
    ll ans = 1;
    for (ll i = 2; i <= n; ++i) {
        ll cur = 1;
        ll c = i;
        for (int j = 0; j < p[i]; ++j) {
            int nd = 0;
            while (c%s[i][j] == 0) {
                ++nd;
                c /= s[i][j];
            }
            cur *= nd + 1;
        }
        ans += i * cur;
    }
    cout << ans << endl;
    */

    /*
    int n; cin>>n;
    vector<int> a(n);
    for (auto& e : a) cin>>e;
    vector<int> b(n);
    for (auto& e : b) cin>>e;
    priority_queue<pair<ll, int>> c;
    for (int i = 0; i < n; ++i) {
        c.push({a[i], i});
    }

    sort(b.begin(), b.end());
    reverse(b.begin(), b.end());
    vector<int> ans(n, -1);
    for (auto e : b) {
        pair<ll, int> t = c.top();
        int prev = t.second == 0 ? n - 1 : i - 1;
        while (ans[t.second] != -1 && ans[prev] != -1) {
            c.pop();
            t = c.top();
            prev = t.second == 0 ? n - 1 : i - 1;
        }
        c.pop();
        c.push({t.first - e, t.second})
        if (ans[t.second] == -1)
    }
    */

}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //int nt; cin>>nt; while (nt--) work();
    work();
    return 0;
}


Measured memory_bytes: 81824
N = int(input())
a = list(map(int,input().split()))
inf = 10**18
res = 0
b = [0]*(N+1)
b[0] = 1-a[0]
for i in range(N):
    tmp = min(2*b[i] - a[i+1], inf)
    if tmp < 0:
        res = -1
        break
    b[i+1] = tmp

if res != -1:
    tmp = 0
    for i in range(N,0,-1):
        tmp += a[i]
        if 2*b[i-1] < tmp:
            tmp = 2*b[i-1]
        res += tmp
    res += 1
if N==0 and a[0]>1:
    res = -1
print(res)


Measured memory_bytes: 20016
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    l,r = LI()
    num = r-l+1
    ans = 0
    if num < 2019:
        ans = 2020
        for i in range(l,r+1):
            for j in range(i+1,r+1):
                ans = min(ans,i*j%2019)

    print(ans)
main()

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll mod = 1000000007;

int main() {
  int n, m;
  cin >> n >> m;
  int a;
  vector<int> oks(n + 1, true);
  for (int i = 0; i < m; ++i) {
    cin >> a;
    oks[a] = false;
  }

  vector<ll> dp(n + 1);
  dp[0] = 1;
  for (int now = 0; now < n; ++now) {
    for (int next = now + 1; next <= min(n, now + 2); ++next) {
      if (oks[next]) {
        dp[next] += dp[now];
        dp[next] %= mod;
      }
    }
  }

  cout << dp[n] << endl;
  return 0;
}


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

using namespace std;
#define ll long long
#define fr(i,s,e) for(i=s;i<e;i++)
int main(){
    ll n,i,flag=1,x=0;
    cin>>n;
    ll a[n];
    fr(i,0,n)
    cin>>a[i];

    fr(i,0,n){
    	flag=1;
        while(flag)
        {
        if(a[i]%2==0)
            {a[i]=a[i]/2;x++;}
        else
            flag=0;
        }
    }
    cout<<x;
    
return 0;
}


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

#ifdef _PRINTDEBUG
  #include "lib/printdebug.hpp"
#else
  #define printdebug(...) 1
#endif
#define I1000000007 (1000000007)
#define I998244353   (998244353)
#define IINF             (1<<28)
#define LINF           (1LL<<60)
#define ALL(a)         (a).begin(), (a).end()
#define rep(i, n)      REP(i, 0, (n))
#define repc(i, n)     REPC(i, 0, (n))
#define REP(i, n, m)   for (int i = (int)(n); i <  (int)(m); i++)
#define REPC(i, n, m)  for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
#define yesno(cond)       YESNO((cond), "Yes", "No")
#define YESNO(cond, a, b) cout << ((cond) ? (a) : (b)) << "\n"
template<class T> inline bool chmin(T& a, const T& b) {
  if (a > b) { a = b; return true; } else return false;
}
template<class T> inline bool chmax(T& a, const T& b) {
  if (a < b) { a = b; return true; } else return false;
}

namespace solver {
  using namespace std;
  using ll = long long;

  ll N, A, B;

  void init() {
    cin >> N >> A >> B;
  }

  void solve() {
    ll ans = 3*N;
    if(abs(B-A)%2==0) {
      chmin(ans, (B-A)/2);
    } else {
      chmin(ans, (A+B-1)/2);
      chmin(ans, (2*N-A-B+1)/2);
    }
    cout << ans << "\n";
  }
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  solver::init();
  solver::solve();
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;

constexpr char px[19] = {1,1,2,2,2,3,3, 0,0,0,1,1,2,2,3,3,4,4,4};
constexpr char py[19] = {1,2,1,2,3,2,3, 0,1,2,0,3,0,4,1,4,2,3,4};
constexpr char dx[7] = {-1,-1,0,0,0,1,1};
constexpr char dy[7] = {-1,0,-1,0,1,0,1};

string check(string c) {
    for (char& e: c) { e -= '0'; }

    char field[3][5][5];

    for (int j = 0; j < (1<<19); ++j) {
        for (char k = 0; k < 19; ++k) {
            field[0][px[k]][py[k]] = (j & (1 << k)) != 0 ? 1 : 0;
        }

        for (char k = 0; k < 7; ++k) {
            char x = px[k], y = py[k];
            char pattern = 0;
            for (char l = 0; l < 7; ++l) {
                if (field[0][x+dx[l]][y+dy[l]] > 0) {
                    pattern |= (1 << l);
                }
            }
            field[1][x][y] = c[pattern];
        }

        {
            char pattern = 0;
            for (char l = 0; l < 7; ++l) {
                if (field[1][2+dx[l]][2+dy[l]] > 0) {
                    pattern |= (1 << l);
                }
            }
            field[2][2][2] = c[pattern];
        }

        if (field[1][2][2] != field[2][2][2]) {
            return "no";
        }
    }

    return "yes";
}

bool solve() {
    string c;
    cin >> c;
    if (c == "#") { return false; }
    cout << check(c) << endl;
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(solve());
    return 0;
}

Measured memory_bytes: 3244
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include<string>
using namespace std;
//#define int long long
typedef pair<int, int> pii;
typedef priority_queue<pii, vector<pii>, greater<pii> > RPQ;
#define mk make_pair
#define INF (1 << 30)
#define INFL (1ll << 60ll)
#define mod 1000000007

void BubbleSort(int c[100], char d[100], int N){
    bool flag = true;
    while(flag){
        flag = false;
        for(int i = N - 1; i > 0; i--){
            if(c[i] < c[i - 1]){
                swap(c[i], c[i - 1]);
                swap(d[i], d[i - 1]);
                flag = true;
            }
        }
    }
    return;
}

void SelectionSort(int c[100], char d[100], int N){
    for(int i = 0; i < N; i++){
        int minj = i;
        for(int j = i; j < N; j++){
            if(c[minj] > c[j]){
                minj = j;
            }
        }
        if(minj != i){
            swap(c[minj], c[i]);
            swap(d[minj], d[i]);
        }
    }
    return;
}

signed main(){
    int N;
    cin >> N;
    char d[3][100];
    int c[3][100];
    for(int i = 0; i < N; i++){
        cin >> d[2][i] >> c[2][i];
        c[0][i] = c[2][i];
        d[0][i] = d[2][i];
        c[1][i] = c[2][i];
        d[1][i] = d[2][i];
        //printf("%d %c%d\n", i, d[2][i], c[2][i]);
    }
    BubbleSort(c[0], d[0], N);
    SelectionSort(c[1], d[1], N);
    string s[3][10];
    for(int i = 0; i < N; i++){
        for(int j = 0; j < 3; j++){
            s[j][c[j][i]] += d[j][i];
        }
    }
    string flag[2] = {"Stable", "Stable"};
    for(int i = 1; i < 10; i++){
        if(s[2][i] != s[0][i])flag[0] = "Not stable";
        if(s[2][i] != s[1][i])flag[1] = "Not stable";
        //cout << i << ": " << s[0][i] << " " << s[1][i] << " " << s[2][i] << endl;
    }
    for(int i = 0; i < 2; i++){
        for(int j = 0; j < N; j++){
            cout << d[i][j] << c[i][j] << ((j == N - 1) ? "\n" : " ");
        }
        cout << flag[i] << endl;
    }


    return 0;
}

/*

*/


Measured memory_bytes: 3164
#include <iostream>
#include <string>
#include <cmath>
#define MOD 1000000007
using namespace std;

int main() {
	long long int n,div = -1,ret = 1;
	long long int h1[100000],h2[100000];
	cin >> n;
	int ma = 0,mai;
	for(int i = 0;i < n;i++){
		cin >> h1[i];
		if(ma < h1[i]){
			ma = h1[i];
			mai = i;
		}
	}
	for(int i = 0;i < n;i++){
		cin >> h2[i];
		if(i >= 1 && div == -1 && h2[i - 1] != h2[i]) div = i - 1;
	}
	if(div == -1) div = n - 1;
	if(h1[n - 1] != h2[0] || div < mai){
		cout << 0 << endl;
		return 0;
	}
	for(int i = 1;i < mai;i++){
		if(h1[i - 1] == h1[i]) {
			ret = (ret * h1[i - 1]) % MOD;
		}
	}
	for(int i = n - 1;i > div;i--){
		if(h2[i] == h2[i - 1]){
			 ret = (ret * h2[i]) % MOD;
		}
	}
	for(int i = mai;i < div - 1;i++) {
		ret = (ret * h1[mai]) % MOD;
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 1920
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-03-17 13:12:59
*/

#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(),(x).end()
#define rep(x, y) for (int x = 0; x < y; x++)
#define MOD 1000000007

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

LL modpower(LL n, LL m, LL mod) {
    if (m == 0) {
        return 1;
    } else if (m % 2 == 0) {
        LL p = modpower(n, m/2, mod);
        return p*p % mod;
    } else {
        return n*modpower(n, m-1, mod) % mod;
    }
}

LL modinv(LL n, LL mod) {
    return modpower(n, mod-2, mod);
}

LL modcombination(LL n, LL r, LL mod) {
    LL ret = 1;

    for (int i = 0; i < r; i++) {
        ret *= (n-i);
        ret %= mod;
        ret *= modinv(i+1, mod);
        ret % mod;
    }

    return ret % mod;
}

ostringstream oss_global;
string s_global = oss_global.str();

int main()
{
    char b;
    cin >> b;

    char ans;
    switch (b) {
        case 'A':
            ans = 'T';
            break;
        case 'C':
            ans = 'G';
            break;
        case 'G':
            ans = 'C';
            break;
        case 'T':
            ans = 'A';
            break;
        default:
            ans = '\n';
            break;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

const int MAX_SIZE = 51;

int field[MAX_SIZE][MAX_SIZE];
int w, h;

int dx[] = {-1, -1, -1, 0, 0, 1, 1, 1},
	dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};

bool ok(int y, int x) {
	return x >= 0 && x < w && y >= 0 && y < h;
}

void consume(int y, int x) {
	bool flag = false;
	for (int i = 0; i < 8; ++i) {
		int curx = x + dx[i],
			cury = y + dy[i];
		if (ok(cury, curx) && field[cury][curx] == 1) {
			field[cury][curx] = 0;
			consume(cury, curx);
		}
	}
}

int main() {
	while (true) {
		cin >> w >> h;
		if (w == 0 && h == 0) break;
		for (int i = 0; i < h; ++i) for (int j = 0; j < w; ++j)
			cin >> field[i][j];

		int res = 0;
		for (int i = 0; i < h; ++i) for (int j = 0; j < w; ++j) {
			if (field[i][j] == 1) {
				field[i][j] = 0;
				consume(i, j);
				++res;
			}
		}
		
		cout << res << endl;
	}
	return 0;
}

Measured memory_bytes: 1240
from collections import defaultdict
s = int(input())
mem = defaultdict(int)

def f(n):
    if n % 2 == 0:
        return n//2
    else:
        return 3*n + 1
m = 1
while 1:
    if mem[s] == 1:
        print(m)
        exit()
    else:
        mem[s] = 1
        s = f(s)
        m += 1

Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#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,t;
  cin >> a >> b >> t;
  cout << (t/a*b) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  
  if (S == "AAA") {
    cout << "No" << endl;
  }
  else if (S == "BBB") {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
#line 2 "header.hpp"

//%snippet.set('header')%
//%snippet.fold()%
#ifndef HEADER_H
#define HEADER_H

// template version 2.0
using namespace std;
#include <bits/stdc++.h>

// varibable settings
const long long INF = 1e18;
template <class T> constexpr T inf = numeric_limits<T>::max() / 2.1;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define _rrep(i, n) rrepi(i, 0, n)
#define rrepi(i, a, b) for (ll i = (ll)((b)-1); i >= (ll)(a); --i)
#define r_rep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(i, a) for (auto &&i : a)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(...) make_tuple(__VA_ARGS__)
#define ub upper_bound
#define lb lower_bound
#define lpos(A, x) (lower_bound(all(A), x) - A.begin())
#define upos(A, x) (upper_bound(all(A), x) - A.begin())
template <class T, class U> inline void chmax(T &a, const U &b) { if ((a) < (b)) (a) = (b); }
template <class T, class U> inline void chmin(T &a, const U &b) { if ((a) > (b)) (a) = (b); }
template <typename X, typename T> auto make_table(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto make_table(X x, Y y, Z z, Zs... zs) { auto cont = make_table(y, z, zs...); return vector<decltype(cont)>(x, cont); }

#define cdiv(a, b) (((a) + (b)-1) / (b))
#define is_in(x, a, b) ((a) <= (x) && (x) < (b))
#define uni(x) sort(all(x)); x.erase(unique(all(x)), x.end())
#define slice(l, r) substr(l, r - l)

typedef long long ll;
typedef long double ld;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;

template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
void check_input() { assert(cin.eof() == 0); int tmp; cin >> tmp; assert(cin.eof() == 1); }

#if defined(PCM) || defined(LOCAL)
#else
#define dump(...) ;
#define dump_1d(...) ;
#define dump_2d(...) ;
#define cerrendl ;
#endif

#endif /* HEADER_H */
//%snippet.end()%
#line 2 "solve.cpp"
template<class T=ll> using vec = vector<T>;
struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;


int solve() {
    string s;cin>>s;
    int n = sz(s);
    if (s[n-1] == 's'){
        s += "es";
        cout << s << endl;
    }
    else{
        s += "s";
        cout << s << endl;
    }
    return 0; 
}


int main(){/*{{{*/
    solve();
    check_input();
    return 0;
}/*}}}*/


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;
typedef pair<int, int> P;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

void YN(bool flg){if(flg) cout << "YES" << endl; else cout << "NO" << endl;}
void Yn(bool flg){if(flg) cout << "Yes" << endl; else cout << "No" << endl;}
void yn(bool flg){if(flg) cout << "yes" << endl; else cout << "no" << endl;}

int main()
{
    string s;
    cin >> s;
    int q;
    cin >> q;
    string t;
    rep(i, q) {
        int ti;
        cin >> ti;
        if(ti == 1) {
            swap(t, s);
        } else {
            int f;
            char c;
            cin >> f >> c;
            if(f == 1) {
                t += c;
            } else {
                s += c;
            }
        }
    }

    reverse(all(t));
    t += s;
    cout << t << endl;

    return 0;
}


Measured memory_bytes: 1128
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
    string s;
    cin>>s;

    if(s == "SUN")
        printf("7");
    else if(s == "MON")
        printf("6");
    else if(s == "TUE")
        printf("5");
    else if(s == "WED")
        printf("4");
    else if(s == "THU")
        printf("3");
    else if(s == "FRI")
        printf("2");
    else if(s == "SAT")
        printf("1");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;
using vpii = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using pii = pair<int, 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 rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--)
#define rreps(i,n) for(int i = (int)(n); i > 0; i--)
#define FOR(i,a,b) for(int i = (int)(a); i <= (int)(b); i++)
#define RFOR(i,a,b) for(int i = (int)(a); i >= (int)(b); i--)
#define all(x) (x).begin(), (x).end()
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
template <class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = INT_MAX;
const int MOD = 1000000007;
#define int long long

int gcd(int a, int b) {
    return b ? gcd(b, a%b) : a;
}

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

signed main() {
    int A, B;
    cin >> A >> B;
    cout << lcm(A, B) << endl;
}

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

// repetition
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

// const value
// const ll MOD = 1e9 + 7;
// const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
// const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline ll toLL(string s) {
  ll v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}

template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  reverse(all(s));
  ll n = s.size();
  string str[] = {"dreamer", "eraser", "dream", "erase"};
  rep(i, 4) reverse(all(str[i]));

  while(s.size() > 0) {
    if(s.size() < 5) {
      cout << "NO"
           << "\n";
      return 0;
    }
    bool okFlag = false;
    rep(j, 4) {
      if(s.substr(0, str[j].size()) == str[j]) {
        s = s.substr(int(str[j].size()));

        okFlag = true;
        break;
      }
    }
    if(not okFlag) {
      cout << "NO"
           << "\n";
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define re 
int f[510][510],gg[510][1020],*g[510],c[510][510];
inline int abss(re int a){return a>0?a:-a;}
int main()
{
	re int n,mod=1e9+7;
	scanf("%d",&n);
	for(re int i=1;i<=n;i++)
	{
		g[i]=gg[i]+510;
	}f[1][0]=f[1][1]=n;c[0][0]=1;
	for(re int i=1;i<=n;i++)
	{
		c[i][0]=c[i][i]=1;
		for(re int j=1;j<i;j++)
		{
			c[i][j]=(c[i-1][j]+c[i-1][j-1])%mod;
		}
	}
	for(re int i=1;i<=n;i++)
	{
		for(re int j=-i;j<=i;j++)
		if(g[i][j])
		{
			{//printf("*%d %d %d\n",i,j,g[i][j]);
				for(re int x=(j<=0?(-j)%2:j);i+x<=n;x+=2)f[i+x][abss((j+x)/2)]=(f[i+x][abss((j+x)/2)]+(long long)
				g[i][j]*c[n-i][x])%mod;
			}
		}
		for(re int j=0;j<=i;j++)if(f[i][j])
		{
			for(re int x=1;i+x<=n;x++)
			{
				if(x>=j&&(!((j+x)%2)))f[i+x][(j+x)/2]=(f[i+x][(j+x)/2]+(long long)f[i][j]*c[n-i][x])%mod;
				g[i+x][j-x]=(g[i+x][j-x]+(long long)f[i][j]*c[n-i][x])%mod;
			}
		}
	}
	printf("%d\n",f[n][0]);
}

Measured memory_bytes: 640
import math
X = int(input())
if X == 2 or X == 3:
    print(X)
    exit()
while True:
    p = True
    for i in range(2, int(math.sqrt(X) + 1)):
        if math.gcd(X, i) > 1:
            p = False
            break
    if p == True:
        print(X)
        exit()
    X += 1

Measured memory_bytes: 9100
import math
a,b,x=map(float,input().split())
if x>=a*a*b/2:
  y=2*(a*a*b-x)/(a*a)
  print(math.degrees(math.atan(y/a)))
else:
  y=2*x/(a*b)
  print(math.degrees(math.atan(b/y)))

Measured memory_bytes: 3060