akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

ll mod(ll a, ll b){
  ll ret=a%b;
  if(ret<0) ret+=b;
  return ret;
}

ll modpow(ll a,ll b,ll c){
  ll res=1;
  while(b>0){
    if(b&1) res=mod(res*a,c);
    a=mod(a*a,c);
    b>>=1;
  }
  return res;
}

int main() {
  int h,w,m;
  cin>>h>>w>>m;
  map<int,int> memo1,memo2;
  set<P> bomb;
  int ta[m],yo[m];
  for(int i=0;i<m;i++){
    cin>>ta[i]>>yo[i];
    memo1[ta[i]]++;memo2[yo[i]]++;
    bomb.insert(make_pair(ta[i],yo[i]));
  }
  set<int> mt,my;
  int maxt=0,maxy=0;
  for(auto itr=memo1.begin();itr!=memo1.end();itr++){
    maxt=max(maxt,itr->second);
  }
  for(auto itr=memo2.begin();itr!=memo2.end();itr++){
    maxy=max(maxy,itr->second);
  }
  for(auto itr=memo1.begin();itr!=memo1.end();itr++){
    if(maxt==itr->second) mt.insert(itr->first);
  }
  for(auto itr=memo2.begin();itr!=memo2.end();itr++){
    if(maxy==itr->second) my.insert(itr->first);
  }
  if((ll)mt.size()*(ll)my.size()>(ll)m){
    cout<<maxt+maxy<<endl;
    return 0;
  }
  int ans=maxt+maxy-1;
  for(auto itr1=mt.begin();itr1!=mt.end();itr1++){
    for(auto itr2=my.begin();itr2!=my.end();itr2++){
      P temp=make_pair(*itr1,*itr2);
      if(!bomb.count(temp)){
        ans=maxt+maxy;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 76260
#!/usr/bin/env python3
#ABC128 E

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,q = LI()
stx = [LI() for _ in range(n)]
d = [I() for _ in range(q)]
stx.sort(key = lambda x:(x[2],x[0]))
ans = [-1]*q
skip = [-1]*q
for s,t,x in stx:
    l = bl(d,s-x)
    r = bl(d,t-x)
    while l < r:
        if ans[l] < 0:
            skip[l] = r
            ans[l] = x
            l += 1
        else:
            l = skip[l]
print(*ans)



Measured memory_bytes: 113448
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define PI 				acos(-1)
#define mp				make_pair
#define pb				push_back
#define all(a)			(a).begin(), (a).end()
#define sz(a)			a.size()
#define srt(a)			sort(all(a))
#define mem(a, h)		memset(a, (h), sizeof(a))
#define f 				first
#define s 				second
#define MOD1			998244353
#define fore(i, b, e)	for(int i = b; i < e; i++)
#define forg(i, b, e, m)	for(int i = b; i < e; i+=m)
int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

using namespace std;
using namespace __gnu_pbds;

typedef long long 		ll;
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//find_by_order kth largest  order_of_key <
const int tam = 100010;
const int MOD = 1e9+7;
const double EPS = 1e-9;
int s, t, n, c;
int gp[210][210], usados[210], lev[210];
bool visited[110];
vector<vector<int>> g;
bool bfs()
{
	int node;
	queue<int> que;
	que.push(s);
	mem(lev, -1);
	while(!que.empty())
	{
		node = que.front();
		que.pop();
		for(int i = 0; i < g[node].size(); i++)
		{
			if(lev[g[node][i]] == -1 && gp[node][g[node][i]] > 0)
			{
				que.push(g[node][i]);
				lev[g[node][i]] = lev[node] + 1;
			}
		}
	}
	return lev[t] != -1;
}

int dfs(int node, int f)
{
	if(node == t) return f;
	for(;usados[node] < g[node].size(); usados[node]++)
	{
		int u = g[node][usados[node]];
		if(lev[u] != lev[node] + 1 || gp[node][u] <= 0) continue;
		int flow = dfs(u, min(gp[node][u], f));
		if(flow > 0)
		{
			gp[node][u] -= flow;
			gp[u][node] += flow;
			return flow;
		}
	}
	return 0;
}

int maxFlow()
{
	int flujo = 0, ax;
	while(bfs())
	{
		mem(usados, 0);
		while(ax = dfs(s, INT_MAX))
		{
			flujo += ax;
		}
	}
	return flujo;
}


int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	//freopen("qwe.txt", "r", stdin);
	g.assign(202, vector<int>());
	int n;
	cin>>n;
	int x[n], y[n], x1[n], y1[n];
	mem(gp, 0);
	s = 200, t = 201;
	fore(i, 0, n) cin>>x[i]>>y[i];
	fore(i, 0, n) cin>>x1[i]>>y1[i];
	fore(i, 0, n)
	{
		g[200].pb(i);
		g[100 + i].pb(201);
		gp[200][i] = 1;
		gp[i + 100][201] = 1;
	}
	fore(i, 0, n)
	{
		fore(j, 0, n)
		{
			if(x[i] < x1[j] && y[i] < y1[j])
			{
				g[i].pb(100 + j);
				g[100+j].pb(i);
				gp[i][100 + j] = 1;
			}
		}
	}
	cout<<maxFlow()<<'\n';
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS2

Measured memory_bytes: 512
fun main(args : Array<String>) {
    val (N, K, Q) = readLine()!!.split(" ").map { it.toInt() }
    val B = IntArray(N, { K - Q })
    (1..Q).forEach {
        val A = readLine()!!.toInt()
        B[A-1]++
    }

    B.forEach {
        if (it > 0) {
            println("Yes")
        } else {
            println("No")
        }

    }
}

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

int main(){
  int n;
  cin >> n;
  vector<int> s(n);
  rep(i, n) cin >> s.at(i);
  int q, ans = 0, input;
  cin >> q;
  rep(i, q){
    cin >> input;
    rep(j, n){
      if(s.at(j) == input){
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define int long long
#define ld long double
#define fi first
#define se second
#define all(uiet) uiet.begin(),uiet.end()
#define read(UIET) for(int i = 0; i < n; ++i) cin >> UIET[i]
#define out(UIET) for(int i = 0; i < n; ++i) cout << UIET[i]
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vpp vector<pair< int, int > >
#define pll pair<int , int >
#define ppll pair < pll , pll >
#define debug(n1) cout << n1 << endl
#define len(a) ((int) (a).size())
#define endl "\n"
#define mod 1000000007
const int INF=(1LL<<60)-1;
int32_t main(){
    SPEED;
    int n, m, c;
    cin >> n >> m >> c;
    int b[m];
    for(int i = 0; i < m; ++i){
        cin >> b[i];
    }
    int res = 0;
    while(n--){
        int temp = 0;
        for(int i = 0; i < m; ++i){
            int x;
            cin >> x;
            temp += b[i] * x;
        }
        temp += c;
        if(temp > 0) res++;
    }
    cout << res ;
}


Measured memory_bytes: 3552
r1, c1, r2, c2 = map(int, input().split())

MAX = 2 * 10 ** 6 + 2
MOD = 10 ** 9 + 7

# Factorial
fac = [0] * (MAX + 1)
fac[0] = 1
fac[1] = 1
for i in range(2, MAX + 1):
    fac[i] = fac[i - 1] * i % MOD
    
# Inverse factorial
finv = [0] * (MAX + 1)
finv[MAX] = pow(fac[MAX], MOD - 2, MOD)
for i in reversed(range(1, MAX + 1)):
    finv[i - 1] = finv[i] * i % MOD

def f(r, c):
    return fac[r + c] * finv[r] * finv[c]

ans = 0
for i in range(c1, c2 + 1):
    ans += f(r2, i + 1) - f(r1 - 1, i + 1)
    ans %= MOD
print(ans)


Measured memory_bytes: 72156
use std::io;
use std::str::FromStr;

fn main() {
    let mut first_line = String::new();
    io::stdin().read_line(&mut first_line).unwrap();

    let first_line_words:Vec<&str> = first_line.trim().split(" ").collect();
    let _ = i32::from_str(first_line_words[0]).unwrap();
    let x = i32::from_str(first_line_words[1]).unwrap();

    let mut counter = 1;
    let mut position = 0;
    let mut line = String::new();
    io::stdin().read_line(&mut line).unwrap();

    let words:Vec<&str> = line.trim().split(" ").collect();
    for word in words {
        position = position + i32::from_str(word).unwrap();
        if position <= x {
            counter = counter + 1;
        }
    }
    println!("{}", counter);

}

Measured memory_bytes: 4352
#include <stdio.h>
#include <iostream>

using namespace std;
int main()
{
  int n,k;
  double x;
  cin>>n>>k;
  int i=1;
  int h=1;
  do
  {
    x=n/h;
  	if(x>k-1)
    {
      h=h*k;
      i++;
    }
  }while(x>k-1);
    cout<<i<<endl;
}

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

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

bool IsTimeOut(clock_t start_timer){
  clock_t current_timer = clock();
  double T = static_cast<double>(current_timer - start_timer) / CLOCKS_PER_SEC;
  return T > 1.95;
}

unsigned long XorShift(){
    static unsigned long x=123456789,y=362436069,z=521288629,w=88675123;
    unsigned long t;
    t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) );
}

int penalty_func(int delta, int c) {
  return delta * (delta - 1) * c / 2;
}

int main(){

  clock_t start_timer = clock();

  const int N = 26;
  int D;
  cin >> D;
  vector<int> C(N);
  rep(i,N) cin >> C[i];
  vector<vector<int>> S(D, vector<int>(N));
  rep(i,D)rep(j,N) cin >> S[i][j];

  vector<int> schedule_table(D, 0), current_penalty(N, 0);
  int current_score = 0;
  rep(i,D){
    rep(j,N){
      current_penalty[j] += C[j];
    }

    int mx = 0;
    rep(j,N){
      if(S[i][mx]+current_penalty[mx]<S[i][j]+current_penalty[j])mx=j;
    }

    schedule_table[i] = mx;

    current_score+=S[i][mx];
    current_penalty[mx]=0;
    rep(j,N){
      current_score-=current_penalty[j];
    }
  }
  /*vector<vector<int>> last_table(D + 1, vector<int>(N, 0));
  repl(i,1,D+1){
    rep(j,N){
      if(schedule_table[i]==j) last_table[i][j]=i;
      else last_table[i][j]=last_table[i-1][j];
    }
  }*/

  while(!IsTimeOut(start_timer)) {
    int a = (int)(XorShift() % (unsigned long) D);
    int b = (int)(XorShift() % (unsigned long) D);
    int ca = schedule_table[a], cb = schedule_table[b];
    if(a == b || schedule_table[a] == schedule_table[b]) continue;
    if(a > b) swap(a, b);

    int next_score = 0;
    vector<int> next_schedule_table = schedule_table;
    swap(next_schedule_table[a], next_schedule_table[b]);
    current_penalty.assign(N, 0);
    rep(i,D){
      rep(j,N){
        current_penalty[j] += C[j];
      }
      next_score += S[i][next_schedule_table[i]];
      current_penalty[next_schedule_table[i]] = 0;
      rep(j,N){
        next_score -= current_penalty[j];
      }
    }
    if(current_score < next_score) {
      current_score = next_score;
      schedule_table = next_schedule_table;
    }
  }
  rep(i,D)cout<<schedule_table[i]+1<<"\n";
  //dbg(current_score);

  return 0;
}


Measured memory_bytes: 3708
#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> G[N], cost[N];
    for (int i = 0; i < N - 1; i++) {
        int u, v, w;
        cin >> u >> v >> w;
        u--, v--;
        G[u].push_back(v); G[v].push_back(u);
        cost[u].push_back(w); cost[v].push_back(w);
    }

    vector<int> res(N, -1);
    res[0] = 0;
    queue<int> que;
    que.push(0);
    while (!que.empty()) {
        int u = que.front(); que.pop();
        for (int i = 0; i < G[u].size(); i++) {
            int v = G[u][i];
            int c = cost[u][i];

            if (res[v] != -1) continue;
            res[v] = (res[u] + c) % 2;
            que.push(v);
        }
    }

    for (int i = 0; i < N; i++)
        cout << res[i] << endl;
    return 0;
}

Measured memory_bytes: 11904
#include <bits/stdc++.h>
using namespace std;
const int MAX = 2002;
char grid[MAX][MAX];
int r[MAX][MAX], c[MAX][MAX];
int rGrid[MAX][MAX], cGrid[MAX][MAX];

int main() {
    
    // 1. 入力情報取得.
    int H, W;
    scanf("%d %d", &H, &W);
    for(int i = 0; i < MAX; i++) for(int j = 0; j < MAX; j++) grid[i][j] = '#';
    for(int i = 0; i < H; i++) scanf("%s", grid + i), grid[i][W] = '#'; // delete null character `\0`.
    
    // for(int i = 0; i < H + 1; i++){
    //     for(int j = 0; j < W + 1; j++) printf("%c", grid[i][j]);
    //     printf("\n");
    // }
    
    // 2. 行方向で照らされるマスの個数をカウント.
    for(int i = 0; i < H; i++){
        int rIndex = 1;
        for(int j = 0; j < W; j++){
            // '.' が 連続出現している場合は, カウントアップ.
            if(grid[i][j] == '.') r[i][rIndex]++, rGrid[i][j] = rIndex;
            // '.' の 連続出現が終わったら, rIndex を インクリメントして, 次のカウントアップに備える.
            if(grid[i][j] == '#' && j > 0 && grid[i][j - 1] == '.') rIndex++;
        }
    }

    // 3. 列方向で照らされるマスの個数をカウント.
    for(int j = 0; j < W; j++){
        int cIndex = 1;
        for(int i = 0; i < H; i++){
            // '.' が 連続出現している場合は, カウントアップ.
            if(grid[i][j] == '.') c[j][cIndex]++, cGrid[i][j] = cIndex;
            // '.' の 連続出現が終わったら, cIndex を インクリメントして, 次のカウントアップに備える.
            if(grid[i][j] == '#' && i > 0 && grid[i - 1][j] == '.') cIndex++;
        }
    }
    
    // for(int i = 0; i < H + 1; i++){
    //     for(int j = 0; j < W + 1; j++) printf("%d ", rGrid[i][j]);
    //     printf("\n");
    // }
    // printf("\n");
    // for(int i = 0; i < H + 1; i++){
    //     for(int j = 0; j < W + 1; j++) printf("%d ", r[i][j]);
    //     printf("\n");
    // }
    // printf("\n");
    // for(int i = 0; i < H + 1; i++){
    //     for(int j = 0; j < W + 1; j++) printf("%d ", cGrid[i][j]);
    //     printf("\n");
    // }
    // printf("\n");
    // for(int i = 0; i < H + 1; i++){
    //     for(int j = 0; j < W + 1; j++) printf("%d ", c[i][j]);
    //     printf("\n");
    // }
    
    // 4. 照らされるマスの個数の最大値を計算.
    int ans = 0;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            int rIndex = rGrid[i][j], cIndex = cGrid[i][j];
            int count = r[i][rIndex] + c[j][cIndex] - 1;
            ans = max(ans, count);
        }
    }

    // 5. 出力 ～ 後処理.
    printf("%d\n", ans);
    return 0;
    
}

Measured memory_bytes: 66816
// ABC 049 C
#include<bits/stdc++.h>
 
using namespace std;
//container util
//------------------------------------------
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())

#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).begin(),(c).end(),greater<int>())

#define PB(a) push_back(a)

#define ALL(x) (x).begin(),(x).end()
#define MAX_EL(c) *max_element((c).begin(),(c).end())
#define MIN_EL(c) *min_element((c).begin(),(c).end())
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef string str;
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int strchk(str s){
  switch(s[0]){
    case 'm':
      return s.compare(0,5,"maerd")==0 ? 5 : -1;
      break;
    case 'e':
      return s.compare(0,5,"esare")==0 ? 5 : -1;
      break;
    case 'r':
      if(s.compare(0,6,"resare")==0) return 6;
      else return s.compare(0,7,"remaerd")==0 ? 7 : -1;
    default:
      return -2;
      break;
  }
}

int main(){
// magic spell------------------------------
  cin.tie(0);
  ios::sync_with_stdio(false);
//------------------------------------------

  str s;
  str ans;
  cin >> s;
  reverse(ALL(s));
  //VI d(n);
  while(s!=""){
    int pos = strchk(s);
    if(pos<0){ans="NO";break;}
    s.erase(s.begin(),s.begin()+pos);
    if(s=="") ans="YES";
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ms(s, n) memset(s, n, sizeof(s))
#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 sz(a) int((a).size())
#define pconent(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;
const ll MOD =  1e9+7;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
inline ll isqrt(ll k) {ll r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
#define db(v) (cout<<#v<<" = "<<v<<endl)
#define endln (cout<<endl)
template <class T> inline void dbv(T a) {  for(auto x : a){ cout<<x<<", " ;} cout<<endl;}
void output(ll tx)
{
    string s;
    ll k;
    cin>>s>>k;
    FOR(i,0,s.size())
    {
        if(i%k==0)
        {
            cout<<s[i];
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t =1;
    // cin>>t;
    FOR(i,0,t)
    {
        output(i+1) ;
    }
    return 0 ;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            double a = double.Parse(Console.ReadLine());

            Console.WriteLine(a + Math.Pow(a, 2) + Math.Pow(a, 3));
        }
    }
}


Measured memory_bytes: 27840
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			int A = Integer.parseInt(sc.next());
			int B = Integer.parseInt(sc.next());
			int C = Integer.parseInt(sc.next());
			int manzoku = Math.min((B / A), C);
			System.out.println(manzoku);
		} // Scanner Close
	}
}

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

const int MAXN=100000+10;
struct Day{
	int a,b,c;
}d[MAXN];
int dp[MAXN][3];

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;++i)
		cin>>d[i].a>>d[i].b>>d[i].c;
	dp[0][0]=d[0].a;
	dp[0][1]=d[0].b;
	dp[0][2]=d[0].c;
	for(int i=1;i<n;++i){
		dp[i][0]=d[i].a+max(dp[i-1][1],dp[i-1][2]);
		dp[i][1]=d[i].b+max(dp[i-1][0],dp[i-1][2]);
		dp[i][2]=d[i].c+max(dp[i-1][0],dp[i-1][1]);
	}
	cout<<max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2])<<endl;
	return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <cstdio>
#include <sstream>

#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <queue>
#include <stack>

#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>

#include <chrono>
#include <random>

using namespace std;
using i64 = int_fast64_t;
using ui64 = uint_fast64_t;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<i64>;
using vvl = vector<vl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pll = pair<i64, i64>;

//////////////////////////////////////////////////

int main(){
    int a,b,t;
    cin >> a >> b >> t;
    cout << t / a * b << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 9)

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rnk = [0]*(n+1)

    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            self.root[x] = self.Find_Root(self.root[x])
            return self.root[x]

    def Unite(self, x, y):
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        if(x == y):
            return 

        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
    
    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    
    def Count(self, x):
        return -self.root[self.Find_Root(x)]

n, m = map(int, input().split())
uf = UnionFind(n)

for i in range(m):
    a, b = map(int, input().split())
    uf.Unite(a, b)

ans = 0

for i in range(n):
    ans = max(ans, uf.Count(i))

print(ans)

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

using namespace std;

#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define sz(X) (int)(X).size()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define forab(i, a, b) for(int i = int(a); i < int(b); i++)
#define all(X) X.begin(), X.end()

typedef long long ll;
typedef pair<int, int> pii;
typedef double dbl;
typedef long double ld;
typedef vector<int> vi;
typedef vector<pair<ll, ll>> vpll;

mt19937 tw(566);
uniform_int_distribution<ll> ll_distr;

ll rnd(ll a, ll b) {
    return ll_distr(tw) % (b - a + 1) + a;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<ll> a(n);
    forn(i, n) cin >> a[i];
    vector<vpll> dp(n, vpll(2, {0, 0}));
    dp[0][1] = {1000, 0};
    forn(i, n - 1) {
        forn(j, 2) {
            pair<ll, ll> p1 = {dp[i][j].fst + dp[i][j].snd * 1ll * a[i], 0};
            if (p1.fst > dp[i + 1][0].fst || (p1.fst == dp[i + 1][0].fst && p1.snd > dp[i + 1][0].snd))
                dp[i + 1][0] = p1;
            if (p1.snd > dp[i + 1][1].snd || (p1.snd == dp[i + 1][1].snd && p1.fst > dp[i + 1][1].fst))
                dp[i + 1][1] = p1;
            pair<ll, ll> p2 = {dp[i][j].fst % a[i], dp[i][j].snd + (dp[i][j].fst / a[i])};
            if (p2.fst > dp[i + 1][0].fst || (p2.fst == dp[i + 1][0].fst && p2.snd > dp[i + 1][0].snd))
                dp[i + 1][0] = p2;
            if (p2.snd > dp[i + 1][1].snd || (p2.snd == dp[i + 1][1].snd && p2.fst > dp[i + 1][1].fst))
                dp[i + 1][1] = p2;
        }
    }
    ll ans = LONG_LONG_MIN;
    forn(i, 2) {
        ans = max(ans, dp[n - 1][i].fst + dp[n - 1][i].snd * a[n - 1]);
    }
    cout << ans << "\n";
    return 0;
}

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

namespace AtCoder2 {
	class Program {
		static void Main(string[] args) {

			var inputArray = retreiveLongArray();
			var inputCount = 1;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			long N = inputArray[0];
			var Ichi = N % 10;

			if (Ichi==3) {
				var ans = "bon";
				Console.WriteLine(ans);
				return;
			}
			if (Ichi == 0 | Ichi == 1| Ichi == 6| Ichi == 8) {
				var ans = "pon";
				Console.WriteLine(ans);
			}
			else {
				var ans = "hon";
				Console.WriteLine(ans);
			}


		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}
	}
}


Measured memory_bytes: 28080
#include <stdio.h>
#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define MAX_V 100
#define rep(i, s, c) for (int i = s; i < c; i++)
#define INF 100000005

int main()
{
    int H, N;
    cin >> H >> N;
    int A[N], B[N];
    rep(i, 0, N)
    {
        cin >> A[i] >> B[i];
    }
    int dp[H + 1];
    dp[0] = 0;
    rep(h, 1, H + 1)
    {
        dp[h] = INF;
    }
    rep(h, 1, H + 1)
    {
        rep(n, 0, N)
        {
            dp[h] = min(dp[h], B[n] + dp[max(h - A[n], 0)]);
        }
    }
    cout << dp[H] << endl;
}

Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		while(solve());
	}
	
	@SuppressWarnings("unchecked")
	public static boolean solve() {

		int n = sc.nextInt();
		if (n == 0) {
			return false;
		}
		int[] p = new int[n-1];
		int[] d = new int[n-1];
		for(int i=0;i<n-1;i++) {
			p[i] = sc.nextInt();
		}
		for(int i=0;i<n-1;i++) {
			d[i] = sc.nextInt();
		}
		
		ArrayList<Edge>[] tree1 = new ArrayList[n];
		
		for(int i=0;i<n;i++) {
			tree1[i] = new ArrayList<>();
		}
		
		for(int i=0;i<n-1;i++) {
			int u = i + 1;
			int v = p[i] - 1;
			tree1[u].add(new Edge(v, d[i]));
			tree1[v].add(new Edge(u, d[i]));
		}
		
		ArrayList<Edge>[] tree2 = new ArrayList[n];
		for(int i=0;i<n;i++) {
			tree2[i] = new ArrayList<>();
		}
		
		boolean[] nonleaf = new boolean[n];
		for(int i=0;i<n;i++) {
			nonleaf[i] = tree1[i].size() >= 2;
		}
		
		for(int i=0;i<n;i++) {
			for(Edge e: tree1[i]) {
				if (nonleaf[i] && nonleaf[e.to]) {
					tree2[i].add(e);
				}
			}
		}
		
		int cost = 0;
		for(int i=0;i<n;i++) {
			for(Edge e: tree1[i]) {
				cost += e.cost;
			}
			for(Edge e: tree2[i]) {
				cost += e.cost * 2;
			}
		}
		cost /= 2;
		
		int start = -1;
		for(int i=0;i<n;i++) {
			if (nonleaf[i]) {
				start = i;
				break;
			}
		}
		int[] dist1 = dist(start, tree2, n);
		int far = -1;
		int distmax = -1;
		for(int i=0;i<n;i++) {
			if (nonleaf[i] && dist1[i] > distmax) {
				far = i;
				distmax = dist1[i];
			}
		}
		
		int[] dist2 = dist(far, tree2, n);
		for(int i=0;i<n;i++) {
			if (nonleaf[i] && dist2[i] > distmax) {
				distmax = dist2[i];
			}
		}
		
		cost -= distmax;
		
		System.out.println(cost);
		
		return true;
	}
	
	static int INF = 1 << 29;
	static int[] dist(int s,ArrayList<Edge>[] tree,int n) {
		int[] dist = new int[n];
		Arrays.fill(dist, INF);
		dist[s] = 0;
		Queue<Integer> q = new ArrayDeque<>();
		q.offer(s);
		while(!q.isEmpty()) {
			int v = q.poll();
			for(Edge e: tree[v]) {
				if (dist[e.to] > dist[v] + e.cost) {
					dist[e.to] = dist[v] + e.cost;
					q.offer(e.to);
				}
			}
		}
		return dist;
	}

}
class Edge {
	int to,cost;

	public Edge(int to, int cost) {
		super();
		this.to = to;
		this.cost = cost;
	}

	@Override
	public String toString() {
		return "Edge [to=" + to + ", cost=" + cost + "]";
	}
	
	
	
}

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

using namespace std;
typedef long long ll;

int main() {
  string S; cin >> S;
  bool yymm = false, mmyy = false;
  if ((S[2] == '0' && S[3] != '0') || (S[2] == '1' && (S[3] == '1' || S[3] == '2' || S[3] == '0'))) yymm = true;
  if ((S[0] == '0' && S[1] != '0') || (S[0] == '1' && (S[1] == '1' || S[1] == '2' || S[1] == '0'))) mmyy = true;
  if (yymm && mmyy) {
    cout << "AMBIGUOUS" << endl;
  } else if (yymm) {
    cout << "YYMM" << endl;
  } else if (mmyy) {
    cout << "MMYY" << endl;
  } else {
    cout << "NA" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < n; i++)

using namespace std;

void solve() {
  long N;
  cin >> N;
  long maxA = 0;
  long memoB;
  rep (i, N) {
    long A, B;
    cin >> A >> B;
    if (A > maxA) {
      maxA = A;
      memoB = B;
    }
  }
  cout << memoB + maxA << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>
using namespace std;

typedef long long LL;
const int MAX = 100001 * 2;
const LL MOD = 1000000007;

long long fact[MAX];
long long inv[MAX];


LL mod_pow(LL x,LL n){
    LL ret = 1;

    while(n){
        if(n & 1)ret = ret * x % MOD;
        x = x * x % MOD;
        n /= 2;
    }

    return ret;
}

LL mod_P(int n,int k){
    return fact[n] * inv[n - k] % MOD;
}

LL mod_C(int n,int k){
    return mod_P(n,k) * inv[k] % MOD;
}

void init(){
    fact[0] = inv[0] = 1;
    for(int i = 1;i < MAX;i++){
        fact[i] = fact[i - 1] * i % MOD;
        inv[i] = mod_pow(fact[i],MOD - 2);
    }
}

int main(){
    init();
    int N,M,K;
    long long x = 0,y = 0;

    cin >> N >> M >> K;

    for(long long i = 0;i < N;i++)x += i * (N-i) * pow(M,2);
    for(long long i = 0;i < M;i++)y += i * (M-i) * pow(N,2);

    cout << mod_C(N*M - 2,K-2) * ((x + y) % MOD) % MOD << endl;

    return 0;
}

Measured memory_bytes: 3328
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <map>
#include <bitset>
using namespace std;
typedef long long int lli;
int main(void)
{
    int x[5];
    for (int i = 0; i < 5; i++)
    {
        cin >> x[i];
    }
    for (int i = 0; i < 5; i++)
    {
        if (x[i] == 0)
        {
            cout << i + 1 << endl;
            return 0;
        }
    }
    return 0;
}


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

int main(int argc, char const *argv[])
{
    int K, X;
    cin >> K >> X;

    int start_point = X - (K - 1);
    int end_point = X + K;
    for (; start_point < end_point; start_point++)
    {
        cout << start_point;
        if (start_point != end_point - 1)
            cout << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

using namespace std;

vector<int> find_times(const std::string str, const std::string subStr) {
    vector<int> result;
 
    int subStrSize = subStr.size();
    int pos = str.find(subStr);
    // int times = 0;
 
    while (pos != std::string::npos) {
        result.push_back(pos);
        pos = str.find(subStr, pos + subStrSize);
    }
 
    return result;
}

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

    vector<int> findvec = find_times(s, "ABC");

    size_t size = findvec.size();
    cout << size << endl;
    
    return 0;
        
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	a := make([]int, n)
	for i := range a {
		fmt.Scan(&a[i])
		a[i]-- // 0-indexed
	}
	b := make([]int, n)
	for i := range b {
		fmt.Scan(&b[i])
	}
	c := make([]int, n-1)
	for i := range c {
		fmt.Scan(&c[i])
	}
	ans := 0
	for i := 0; i < n; i++ {
		ans += b[a[i]]
		if i > 0 && a[i-1]+1 == a[i] {
			ans += c[a[i-1]]
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
package main

import (
	"fmt"
	"strconv"
)

var H, W int
var a [][]string
var r []string

func main() {
	var s string

	fmt.Scan(&H, &W)
	sx := []int{1, 1, 0, -1, -1, -1, 0, 1}
	sy := []int{0, 1, 1, 1, 0, -1, -1, -1}

	for i := 0; i < H; i++ {
		fmt.Scan(&s)
		w := make([]string, W)
		for j, v := range s {
			w[j] = string(v)
		}
		a = append(a, w)
	}
	for i := 0; i < H; i++ {
		ry := ""
		for j := 0; j < W; j++ {
			if a[i][j] == "#" {
				ry += "#"
			} else {
				cnt := 0
				for p := 0; p < 8; p++ {
					if drf(j+sx[p], i+sy[p]) {
						cnt++
					}
				}
				ry += strconv.Itoa(cnt)
			}
		}
		fmt.Println(ry)
		r = append(r, ry)
	}
}
func drf(x, y int) bool {
	if x >= W || y >= H || x < 0 || y < 0 {
		return false
	}
	if a[y][x] == "#" {
		return true
	}
	return false
}

Measured memory_bytes: 640
import bisect as bi

if __name__ == '__main__':

    x,n = map(int,input().split())
    A = list(map(int,input().split()))
    B = [i for i in range(102)]
    
    #差分を求める
    C = list(set(B) - set(A))

    #二分探索自身の位置を調べる
    ind = bi.bisect_left(C,x)

    if ind == 0:
        print(C[0])
    elif ind == x - n:
        print(C[ind])
    else:
        tmp_l = abs(C[ind-1] - x)
        tmp_r = abs(C[ind] - x)
        if tmp_l > tmp_r:
            print(C[ind])
        else:
            print(C[ind-1])


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

typedef long long ll;
typedef pair <int, int> ii;

const int Maxn = 100005;
const int mod = 998244353;

int n;
int diag[Maxn], dif[Maxn];
map <ii, int> M;
int dp[Maxn][2];

int main()
{
    fill(diag, diag + Maxn, -1);
    fill(dif, dif + Maxn, -1);
    scanf("%d", &n);
    int m; scanf("%d", &m);
    for (int i = 0; i < m; i++) {
        int r, c, val; scanf("%d %d %d", &r, &c, &val);
        if (r == c)
            if (diag[r] != -1 && diag[r] != val) {
                printf("0\n"); return 0;
            } else diag[r] = val;
        else {
            if (r < c) swap(r, c);
            map <ii, int>::iterator it = M.find(ii(r, c));
            int oldval = it == M.end()? -1: it->second;
            int st = r - c;
            if (st == 1)
                if (oldval == -1) M[ii(r, c)] = val;
                else {
                    int wr = oldval != val;
                    if (dif[r] != -1 && dif[r] != wr) {
                        printf("0\n"); return 0;
                    } else dif[r] = wr;
                }
            else if (st == 2)
                if (oldval == -1) M[ii(r, c)] = val;
                else {
                    int wr = oldval != val;
                    if (diag[r - 1] != -1 && diag[r - 1] != wr) {
                        printf("0\n"); return 0;
                    } else diag[r - 1] = wr;
                }
            else if (oldval == -1) M[ii(r, c)] = val;
                 else if (oldval != val) {
                    printf("0\n"); return 0;
                 }
        }
    }
    dp[1][0] = 1;
    for (int i = 1; i <= n; i++)
        for (int j = 0; j < 2; j++) if (dp[i][j])
            for (int k = 0; k < 2; k++) {
                if (diag[i] != -1 && diag[i] != k) continue;
                if (dif[i] != -1 && dif[i] != (j != k)) continue;
                dp[i + 1][k] = (dp[i + 1][k] + dp[i][j]) % mod;
            }
    int res = (dp[n + 1][0] + dp[n + 1][1]) % mod;
    ll rem = (ll(n) * n - n) / 2 - int(M.size());
    int a = 2;
    while (rem) {
        if (rem & 1) res = ll(res) * a % mod;
        rem >>= 1ll; a = ll(a) * a % mod;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <cstring>
#include <cctype>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <complex>
using namespace std;
#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 pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
const int INF = 1<<28;
const ll MOD = 1000000007;

int main() {
	vector<bool> prime(1<<15, true);
	prime[0] = prime[1] = false;
	FOR(i, 2, 1<<15) {
		if(prime[i]) {
			for(int j=i*2; j < 1<<15; j += i)
				prime[j] = false;
		}
	}
	int n;
	while(cin >> n, n) {
		int cnt = 0;
		REP(i, n) {
			if(prime[i] > n)
				break;
			FOR(j, i, n) {
				if(prime[j] > n)
					break;
				if(prime[i] && prime[j] && i + j == n) {
					cnt++;
				}
			}
		}
		cout << cnt << endl;
	}
	return 0;
}

Measured memory_bytes: 1200
#include<stdio.h>
int main()
{
    char a[200005],b[200005];
    scanf("%s%s",a,b);
    int c=0;
    for(int i=0;a[i]!='\0';i++)
    {
        if(a[i]!=b[i]) c++;
    }
    printf("%d",c);
}


Measured memory_bytes: 2104
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)
#define REV(X, Y, Z) for (ll(X) = (Y); (X) > (Z); (X)--)

using namespace std;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMax = 1e12 + 1;
constexpr ll kMod = 1e9 + 7;
constexpr long double kPI = 3.14159265358979323846;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

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

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  ll X;
  cin >> X;

  ll div = X / 11;
  ll mod = X % 11;
  if (mod == 0) {
    cout << div * 2 << endl;
  } else if (mod <= 6) {
    cout << div * 2 + 1 << endl;
  } else {
    cout << div * 2 + 2 << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define w(t) int t;cin>>t;while(t--)
#define pb   push_back
#define mk   make_pair
#define u_s  unordered_set
#define endl "\n"
#define prDouble(x) cout<<fixed<<setprecision(10)<<x
#define ll long long int
#define ipair pair<int,int>
#define all(x) (x).begin(), (x).end()

const int mod=pow(10,9)+7;

bool compare(pair<int,int>p1,pair<int,int>p2){
    return p1.second<p2.first;
}
/*
  ll C(ll n,ll k){
  
  if(k>n)return 0;
  
  ll ans=1;

  if(k>n-k)
    k=n-k;
  for(ll i=1;i<=k;i++)
    ans*=(n-i+1),ans/=i;

  return ans;
  }
  unsigned long long fact(long long a)
  {
  unsigned long long res=1;
  for(long long i=a;i>0;i--)
    res*=i;
  return res;
  }
  unsigned long long comb(long long a,long long b)
  {
  if((a-b)<b) b=a-b;
  if(a<=19) return fact(a)/(fact(a-b)*fact(b));
  if(a==b||b==0) return 1;
  if(b==1) return a;
  return comb(a-1,b-1)+comb(a-1,b);
  }
*/

int dp[3005][3005];

int lenLCS(string &s,string &t,int i,int j){
   
   if(i==s.size())return 0;
   else if(j==t.size())return 0;
   
   if(dp[i][j]!=-1)return dp[i][j];
   if(s[i]==t[j]){
      dp[i][j]=1+lenLCS(s,t,i+1,j+1);
   }else{
      dp[i][j]=max({lenLCS(s,t,i+1,j),lenLCS(s,t,i,j+1)});
   }
   return dp[i][j];
}
string getLCS(string &s,string &t,int len){
  string LCS;
  int i=0,j=0;
  while(len>0){
    if(s[i]==t[j]){
      LCS.push_back(s[i]);
      i++;
      j++;
      len--;
    }else{
      if(dp[i][j+1]>dp[i+1][j])j++;
      else
        i++;
    }
  }
  return LCS;
}
void solve(){
     
    string s1,s2; cin>>s1>>s2;
    
    memset(dp,-1,sizeof dp);
    int len=lenLCS(s1,s2,0,0);
    
    cout<<getLCS(s1,s2,len);
    
} 

int main(){

  

    ios_base::sync_with_stdio(false); 
    cin.tie(nullptr); 
    cout.tie(nullptr);
    
    solve();

    return 0;  
    
}


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

int main() {

  int A,B,i,n=0;
  cin >> A >> B;
  for(i=A;i<B+1;i++){
    if(i-i/100*100==i/10000+i/1000*10-i/10000*100) n++;
  }
  cout << n << endl;
}

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

int main(){
    double n,m;cin>>n>>m;vector<double> a(n);long long sum=0;
    for(double i=0;i<n;i++){
        cin>>a.at(i);
        sum+=a.at(i);
    }
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    bool check=0;
    double b = sum/(4*m);
    for(double i=0;i<m;i++){
        double get=a.at(i);
        if(get<b){
            check=0;
            break;
        }
        else check=1;
    }
    if(check) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


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

const int N = (int) 1e5 + 5;
const long long MOD = (long long) 1e9 + 7;

int n, m;
int x[N], y[N];

int main() {
	//freopen(".inp", "r", stdin); freopen(".out", "w", stdout);
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
	for (int i = 1; i <= m; i++) scanf("%d", &y[i]);
	sort(x + 1, x + 1 + n);
	sort(y + 1, y + 1 + m);
	long long ansOx = 0, ansOy = 0;
	for (int k = 1; k <= n; k++) {
		ansOx += 1LL * (k - 1) * x[k] - 1LL * (n - k) * x[k];
		ansOx %= MOD;
	}
	for (int k = 1; k <= m; k++) {
		ansOy += 1LL * (k - 1) * y[k] - 1LL * (m - k) * y[k];
		ansOy %= MOD;
	}
	long long ans = ansOy * ansOx % MOD;
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int sum,i;
    char s[10];
    while(~scanf("%s",s))
    {
        sum=0;
        for(i=0; i<4; i++)
        {
            if(s[i]=='-')
                sum=sum-1;
            else
                sum=sum+1;
        }
        printf("%d\n",sum);
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
# define ll int64_t
# define str string
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define PI 3.141592653589793
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;

#define INF 2000000000
#define MAX_V 10

const ll MAX = 510000;
const ll MOD = 1000000007;
 
ll fac[MAX], finv[MAX], inv[MAX];
 
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
// 二項係数計算
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

bool my_compare(pair<string,ll> a,pair<string,ll> b){
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll modpow(ll a,ll n,ll mod1) {
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod1;
        a = a*a%mod1;
        n >>= 1;
    }
    return res;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) (x*=i)%=mod;
    return x;
}

ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b,a%b));
}

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

struct Info{
    Info(ll arg_to,ll arg_cost){
        to = arg_to;
        cost = arg_cost;
    }
    bool operator<(const struct Info &arg) const{
            return cost > arg.cost;
    };
    ll to,cost;
};



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n,sum=0;
    cin>>n;
    rrep(i,n-1) sum+=i;
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 256
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
from re import split
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gamma, log
from operator import mul
from functools import reduce
from copy import deepcopy
import re

sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


s = S()
n = len(s)
a = s[:(n - 1) // 2]
b = s[(n + 3) // 2 - 1:]
if a == a[::-1] and b == b[::-1] and s[::-1] == s:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 39856
#include<stdio.h>
#include<math.h>

int main(void) {
    unsigned long long int n, p;
    unsigned long long int i;
    unsigned long long int count = 0;
    unsigned long long int ans = 1;
    scanf("%llu %llu", &n, &p);

    if ( n == 1 ) {
        printf("%llu\n", p);
        return 0;
    }
    if ( p == 1 ) {
        printf("1\n");
        return 0;
    }
    for ( i = 2; i * i <= p; ) {
        count = 0;
        while ( p % i == 0 ) {
            count++;
            p /= i;
        }
        if ( count / n ) {
            ans *= pow(i, (count/n));
        }
        i++;
    }
    printf("%llu\n", ans);
    return 0;

}

Measured memory_bytes: 128