akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793238;
const double EPS = 1e-10;
ll A[100000];
ll sum[100000];
ll sum2[100000];
int main() {
	int N, Q;
	cin >> N >> Q;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	sum2[N - 1] = A[N - 1];
	for (int i = N - 2; i >= 0; i--) {
		sum2[i] = sum2[i + 1] + A[i];
	}
	sum[0] = A[0];
	sum[1] = A[1];
	for (int i = 2; i < N; i++) {
		sum[i] = sum[i - 2] + A[i];
	}
	for (int i = 0; i < Q; i++) {
		ll X;
		cin >> X;
		if (X <= A[0]) {
			cout << sum2[N / 2] << endl;
			continue;
		}
		if (X >= A[N - 1]) {
			cout << sum[N - 1] << endl;
			continue;
		}
		int x1 = upper_bound(A, A + N, X) - A - 1;
		int l = x1, r = N - 1;
		while ((r - l) > 1) {
			int m = (l + r) / 2;
			ll d = A[m] - X;
			int x2 = lower_bound(A, A + N, X - d) - A;
			int up = N - m;
			int down = m - x2;
			if (down >= up - 1) r = m;
			else l = m;
		}
		int up = N - r;
		int down = r - 1 - (N - r);
		ll ans = sum2[r];
		if (down >= 0) ans += sum[down];
		cout << ans << endl;
	}
}

Measured memory_bytes: 4096
import java.util.Scanner;
import java.util.Stack;
import java.io.*;

class Main {
    static Stack<Integer> ans = new Stack<>();
    static int a;
    static int b;

    private static int compute(String s){
        if (s.charAt(0) == '+') return b + a;
        else if ( s.charAt(0) == '-') return b - a;

        return b * a;
    }

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc = new Scanner(s);

        while(sc.hasNext()){
            if(sc.hasNextInt())
                ans.push(sc.nextInt());
            else{
                a = ans.pop();
                b = ans.pop();
                ans.push(compute(sc.next()));
            }
        }
        System.out.println(ans.pop());
    }
}



Measured memory_bytes: 26732
import sys
import math
import collections
import bisect
import itertools
import decimal

# import numpy as np

# sys.setrecursionlimit(10 ** 6)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===

def main():
    s = list(input())
    t = list(input())

    ls = len(s)
    lt = len(t)

    ans = INF
    for i in range(ls - lt+1):
        cnt = 0
        for j in range(lt):
            if t[j] != s[i + j]:
                cnt += 1
        ans = min(ans, cnt)

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 77388
#include<bits/stdc++.h>
#define endl '\n'
#define ll long long int
#define loop(i,a,b)           for(ll i=a;i<=b;++i)
#define pb                    push_back
#define F                     first
#define S                     second
#define mp                    make_pair
#define clr(x)                x.clear()
#define MOD                   1000000007
#define itoc(c)               ((char)(((int)'0')+c))
#define vl                    vector<ll>
#define SZ(x)                 (x).size()
#define all(p)                p.begin(),p.end()
#define mid(s,e)              (s+(e-s)/2)
#define sv()                  ll t,n; scanf("%lld",&t);n=t; while(t--)
#define tcase()               ll t,n; cin>>t;n=t; while(t--)
#define iscn(num)             scanf("%d",&num);
#define scn(num)              scanf("%lld",&num);
#define dbg(x)                cout <<"( "<<#x << " = " << x << " )"<<endl
using namespace std;
const ll INF = 2e18 + 99;
typedef pair<ll,ll> Pair;
typedef vector<ll> vec;;
void FAST_IO();
void ara_read(vec &v,ll n);
////////////////////////

int main()
{
	ll n; scn(n);
	vec stone;
	ara_read(stone, n);
	vec dp(n,INF);
	dp[0]=0;
	for(int i=0; i< n ; i++){
		for(int j : {i+1, i+2}){
			if(j< n){
				dp[j]=min(dp[j] ,dp[i]+abs(stone[j]-stone[i]));
				
			}
		}
	}
	printf("%lld\n",dp[n-1]);
   return 0;
}

void FAST_IO()
{
    // ios_base::sync_with_stdio(0);
    //cin.tie(NULL);
    //cout.tie(NULL);
    //cout.setf(ios::fixed);
    //cout.precision(2);

}
void ara_read(vec &v,ll n){
	ll temp;
	for(ll i=0; i<n; i++){
		scanf("%lld",&temp);
		v.emplace_back(temp);
	}
	
}


Measured memory_bytes: 1908
X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
AB = []
for a in A:
    for b in B:
        AB.append(a + b)
AB.sort(reverse=True)
C.sort(reverse=True)
ans = []
for ab in AB[:K]:
    for c in C[:K]:
        ans.append(ab + c)
ans.sort(reverse=True)
for i in range(K):
    print(ans[i])






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

int main(){
  int N;
  cin >> N;
  vector<int> a(N), X(110000);
  for(int i=0; i<N; i++){
    cin >> a.at(i);
    X.at(a.at(i))++;
    X.at(a.at(i)+1)++;
    if(a.at(i)!=0){
      X.at(a.at(i)-1)++;
    }
  }
  int ans=0;
  for(int i: X){
    ans=max(ans,i);
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 4000
#!/usr/bin/env python3
#C

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
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()))

h, w = LI()
a = [LI() for _ in range(h)]

ans = []
dx, dy = [1, 0], [0, 1]
for i in range(h):
    for j in range(w):
        if a[i][j] % 2:
            for k in range(2):
                ny, nx = i + dy[k], j + dx[k]
                if 0 <= ny < h and 0 <= nx < w:
                    if a[ny][nx] % 2:
                        a[ny][nx] += 1
                        a[i][j] -= 1
                        ans.append((i, j, ny, nx))
                        break
            else:
                if j + 1 < w:
                    a[i][j+1] += 1
                    a[i][j] -= 1
                    ans.append((i, j, i, j+1))
                elif i + 1 < h:
                    a[i+1][j] += 1
                    a[i][j] -= 1
                    ans.append((i, j, i+1, j))

print(len(ans))
for (i, j, k, l) in ans:
    print(i+1, j+1, k+1, l+1) 

Measured memory_bytes: 71260
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define rrepSE(i,s,e) for (int i = (s); i > (e); i--)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }
#define DEBUG_PRINT(var) std::cout << #var << " = " << var << "\n";

int main()
{
    int a;
    cin >> a;
    int ans = a + a*a + a*a*a;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3620
#include<cstdio>
int n,m,i,j;
char a[505][505];
int main(){
	for (scanf("%d%d",&n,&m),i=1;i<=n;i++)
		scanf("%s",a[i]+1);
	for (i=1;i<=n;i++,putchar('\n')) for (j=1;j<=m;j++){
		if (j==1||j<m&&(i&1)||a[i][j]=='#')
			putchar('#'); else putchar('.');
	}putchar('\n');
	for (i=1;i<=n;i++,putchar('\n')) for (j=1;j<=m;j++){
		if (j==m||j>1&&!(i&1)||a[i][j]=='#')
			putchar('#'); else putchar('.');
	}
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
	int N; cin >> N;
	vector<int> a(N);
	for (int i=0; i<N; i++)
	    cin >> a[i];		
	deque<int> d;
	
	for (int i = 0; i < N;++i) {
		int p = lower_bound(d.begin(), d.end(), a[i])-d.begin();
		if (p == 0) d.push_front(a[i]);
		else d[p - 1] = a[i];
	}
 
	int ans = d.size();
	cout << ans << endl;
}


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

#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define endl '\n'
#define all(x) x.begin(), x.end()

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
using vvll = vector< vector<ll> >;
using vll = vector<ll> ;
using vb = vector<bool> ;
using pll = pair<ll, ll> ;

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e15;


void pre(){



}


void solve(){

    ll n;
    cin >> n;
    ll flg=1;
    for(ll i=0;i<n;i++){
        ll v;
        cin >> v;
        if(v&1);
        else{
            if(v%3 and v%5){
                flg =0 ;
            }
        }
    }
    if(flg){
        cout << "APPROVED";
    }else cout << "DENIED";

}

int main(){
    // #ifndef ONLINE_JUDGE
    // freopen("input00.txt","r",stdin);
    // #endif
    IOS;
    pre();
    ll T = 1;
    //cin>>T;
    while(T--){
        solve();   
    }
    return 0;
}

Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int sum = (1+N)*N/2;
		System.out.println(sum);
	}
}


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

int main(){
	int d; cin>>d;
	if(d==25) cout << "Christmas" << endl;
	else if(d==24) cout << "Christmas Eve" << endl;
	else if(d==23) cout << "Christmas Eve Eve" << endl;
	else cout << "Christmas Eve Eve Eve" << endl;	
}

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

using namespace std;

int main() {
    vector<int> side(3,0);
    int N;
    cin >> N;
    for(int i=0; i<N; ++i) {
        for(int j=0; j<3; ++j) cin >> side[j];
        sort(side.rbegin(), side.rend());
        if(side[0]*side[0]==side[1]*side[1]+side[2]*side[2]) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    return 0;
}



Measured memory_bytes: 3072
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        System.out.println(
            A == B ? "Draw" :
            A == 1 ? "Alice" :
            B == 1 ? "Bob" :
            A > B ? "Alice" : "Bob"
        );
    }
}


Measured memory_bytes: 21460
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int a,int b){return b?gcd(b,a%b):a;}

signed main(){
    int a;
    double b;
    cin >> a >> b;
    b *= 100 + eps;
    int c = b;
    int d = (a * c);
    int f = d/100;
    cout << f << endl;
    return 0;
}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const int maxn = 200005;
map<int,int> mp;
int main()
{
	int n,m;
	int a;
	scanf("%d",&n);
	rep(i,0,n) scanf("%d",&a),mp[a]++;
	int fg=1;
	scanf("%d",&m);
	rep(i,0,m){
		scanf("%d",&a);
		mp[a]--;
		if(mp[a]<0){
			fg=0;
			break;
		}
	}
	puts(fg?"YES":"NO");
	return 0;
}



Measured memory_bytes: 9600
#include <iostream>
#include <string>

using namespace std;

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

    for (int i = 0; i < static_cast<int>(s.size()); i++) {
        if (i % 2 == 0) {
            cout << s[i];
        }
    }

    cout << endl;
}


Measured memory_bytes: 512
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a, b;
		String op;
		while(true){
			a = sc.nextInt();
			op = sc.next();
			b = sc.nextInt();
			if(op.equals("?"))break;
			if( (0<=a) && (b<=20000) ){
				if(op.equals("+")){
					System.out.println(a+b);
				} else if(op.equals("-")){
					System.out.println(a-b);
				} else if(op.equals("*")){
					System.out.println(a*b);
				} else if(op.equals("/")){
					System.out.println(a/b);
				} else{
				}
			}
		}
	}
}

Measured memory_bytes: 18032
#include<stdio.h>
int main(void){
  int i, j, n, so[246913], count;
  for(i=0;i<246913;i++){
    so[i]=1;
  }
  for(i=2;i<246913;i++){
    for(j=2;j<246913;j++){
      if(i*j<246914){
        so[i*j]=0;
      }else{
        break;
      }
    }
  }
  scanf("%d", &n);
  while(n!=0){
    count=0;
    for(i=n+1;i<2*n+1;i++){
      if(so[i]==1){
        count++;
      }
    }
    printf("%d\n", count);
    scanf("%d", &n);
  }

  return 0;
}

Measured memory_bytes: 1564
s=input()
A, B, C, D = [int(s_) for s_ in s]

for ii in range(8):
    first  = ii >> 0 & 1
    second = ii >> 1 & 1
    third  = ii >> 2 & 1
    sum = A
    if first == 0:
        sum -= B
        first_op = '-'
    else:
        sum += B
        first_op = '+'
    if second == 0:
        sum -= C
        second_op = '-'
    else:
        sum += C
        second_op = '+'
    if third == 0:
        sum -= D
        third_op = '-'
    else:
        sum += D
        third_op = '+'
    if sum == 7:
        print(str(A)+first_op+str(B)+second_op+str(C)+third_op+str(D)+'=7')
        exit()


Measured memory_bytes: 3064
#include<stdio.h>
int main(){
int a[13],i,b,c,d,e,f,two=0,three=0,x=13,four=0;
while(scanf("%d,%d,%d,%d,%d\n",&b,&c,&d,&e,&f)!=EOF){
for(i=0;i<13;i++){
a[i]=0;
}
a[b-1]++;
if(x>b-1){
x=b-1;
}
a[c-1]++;
if(x>c-1){
x=c-1;
}
a[d-1]++;
if(x>d-1){
x=d-1;
}
a[e-1]++;
if(x>e-1){
x=e-1;
}
a[f-1]++;
if(x>f-1){
x=f-1;
}
for(i=0;i<13;i++){
if(a[i]==2){
two++;
}
if(a[i]==3){
three++;
}
if(a[i]==4){
four++;
}
}
if(four==1){
printf("four card\n");
}
else if(two==1 && three==1){
printf("full house\n");
}
else if(two==1){
printf("one pair\n");
}
else if(two==2){
printf("two pair\n");
}
else if(three==1){
printf("three card\n");
}
else if(a[x]==1 && a[x+1]==1 && a[x+2]==1 && a[x+3]==1 && a[x+4]==1){
printf("straight\n");
}
else if(a[9]==1 && a[10]==1 && a[11]==1 && a[12]==1 && a[0]==1){
printf("straight\n");
}
else{
printf("null\n");
}
two=0,three=0,x=13,four=0;
}
return 0;
}


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

int main() {
    double N, K;
    cin >> N >> K;
    double P = 0;
    for (int i = 1; i <= N; i++) {
        double initial = i;
        double p = 1/N;
        while (initial < K) {
            initial *= 2;
            p /= 2;
        }
        P += p;
    }

    cout << fixed << setprecision(12);
    cout << P << endl;
    return 0;
}

Measured memory_bytes: 256
N, W = map(int, input().split())
ITEM = []
vmax, wmax = 0,0
for _ in range(N):
  w,v = map(int, input().split())
  ITEM.append((v,w))
  vmax = max(vmax,v)
  wmax = max(wmax,w)

INF = 10**18
    
def solve1():
  #dp[i][v] i個めまで選んで、価値Vを実現するための最小の重量
  # TLEしたらiを消す。
  dp = [INF] * (vmax*N+1)
  dp[0] = 0
  for i in range(1,N+1):
    v1,w1 = ITEM[i-1]
    # dp[i]消すなら、vは大きい方から探索する
    for v in range(vmax*i,-1,-1):
      if v-v1>=0:
        dp[v] = min(dp[v], dp[v-v1]+w1)
  ret = 0
  for i in range(len(dp)):
    if dp[i] <= W:
      ret = max(ret, i)
  #print(dp[:30])
  return ret

ans = solve1()
  
print(ans)

Measured memory_bytes: 11944
<?php
fscanf(STDIN, "%d %d", $x, $n);
$lineInput = trim(fgets(STDIN));
$p= explode(" ", $lineInput);

sort($p);

if(in_array($x,$p)){
    $ans = $p[0] - 1;
    for($i=$ans; $i <= $p[$n - 1] + 1; $i++){
        if(abs($ans - $x) > abs($i - $x) && !in_array($i,$p)){
            $ans = $i;
        }
    }
    echo $ans;
    
}else{
    echo $x;
}
?>

Measured memory_bytes: 16160
#include<iostream>
#include<iomanip>
#include<cstdio>

#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>

#include<algorithm>
#include<cmath>
#include<numeric>

using namespace std;
typedef long long ll;
template <class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template <class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
const ll INF = 1e18+1;


/*
1 <= S(n) <= 9 * (floor(log10 n) + 1)

したがって n / (9 * (floor(log10 n) + 1)) <= n/S(n) <= n

この達成される下界の内、floorの性質からその候補はちょうど10, 100, 1000...に限られる
10 ^ kのとき下界は
10^k/(9*(k+1))

11/2


その桁で一番小さいのは 19...9/S(19...9)
各桁について 99...9/S()以下なら出力?

各桁において
最もn/S(n)が小さいnは何か

n自体の差は最大10倍

1...19...9の形が可能性


editorial
つまり...
一つ目のポイント
「N以上の整数nでn/S(n)を最小にするもの」を求める
関数を作ってN <- f(N+1)を繰り返せばよい

二つ目
Nに対して、それ以上で最小にしえる候補は、
Nの下位数桁を9に置き換えたものとする
そのうち最小にするものを実際に比較する

*/

ll f(ll N) {
    vector<ll> a(20,0);
    ll d = 0;
    while (N > 0) {
        a[d] = N % 10;
        N /= 10;
        d++;
    }
    double m = 1e18;
    ll res = N;
    for (int i = 0; i <= d; i++) {
        ll bunsi = 0;
        ll bunbo = 9 * i;
        for (int j = d-1; j >= 0; j--) {
            bunsi *= 10;
            if (j < i) bunsi += 9;
            else bunsi += a[j];
            
            if (j >= i) bunbo += a[j];
            
        }
        //cout << "bb" << bunsi <<  " " << bunbo << "  " << endl;
        double frac = (double) bunsi / (double) bunbo;
        if (frac < m) {
            m = frac;
            res = bunsi;
        }
    }
    return res;
}

int main() {
    ll K;
    cin >> K;
    ll N = f(1);
    for (ll i = 0; i < K; i++) {
        cout << N << endl;
        N = f(N+1);
    }
    

}



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

int compare(const void *a, const void *b)
{
	return strcmp(a, b);
}
char arr[200001][11], str[200001][11], a[11];
int num[200001];
int main()
{
	int n, i, cnt=1, j=0, max=0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%s", arr[i]);
	}
	qsort((void *) arr, n, sizeof(arr[0]), compare);
	strcpy(a, arr[0]);
	strcpy(str[0], a);
	for (i = 1; i <= n; i++){
		if(strcmp(a,arr[i])==0){
			cnt++;
			continue;
		}
		num[j]=cnt;
		j++;
		strcpy(a, arr[i]);
		strcpy(str[j], a);
		cnt=1;
	}	
	for(i=0; i<=j; i++){
		if(num[i]>max)
			max=num[i];
	}
	for(i=0; i<j; i++){
		if(max==num[i])
			printf("%s\n", str[i]);
	}
	return 0;
}

Measured memory_bytes: 6984
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

int main() {
    string S;
    cin >> S;
    int ans = 0;
    for(auto e:S){
        if(e-'0'==1)++ans;
    }
    cout << ans << '\n';
}


Measured memory_bytes: 3640
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        //char[] c = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
        char[] c = new char[s.length()];
        //int[] n = new int[26];
        
        
        if(s.length()%2==1){
            System.out.println("No");
            return;
        }
        
        for(int i=0; i<s.length(); i++){
            c[i] = s.charAt(i);
        }
        
        Arrays.sort(c);
        
        
        int a=1;
        for(int i=1; i<s.length(); i++){
            if(c[i-1]==c[i]){
                a++;
            }else{
                if(a%2==1){
                    //System.out.println(c[i]);
                    System.out.println("No");
                    return;
                }
                a=1;
            }
            //System.out.print(c[i]);
            //System.out.println(a);
        }
        
        System.out.println("Yes");
   }
}


Measured memory_bytes: 35688
#include<bits/stdc++.h>
 
using namespace std;
 
 
typedef long long int64;
const int mod = 1e9 + 7;
 
struct BinaryIndexedTree
{
  vector< int > data;
 
  BinaryIndexedTree(int sz)
  {
    data.assign(++sz, 0);
  }
 
  int sum(int k)
  {
    int ret = 0;
    for(++k; k > 0; k -= k & -k) (ret += data[k]) %= mod;
    return (ret);
  }
 
  void add(int k, int x)
  {
    for(++k; k < data.size(); k += k & -k) (data[k] += x) %= mod;
  }
 
  int get(int k)
  {
    return ((sum(k) - sum(k - 1) + mod) % mod);
  }
};
 
int main()
{
  int64 N, A, B, X[100000];
  int64 AA[100000], BB[100000];
 
  cin >> N >> A >> B;
  for(int i = 0; i < N; i++) {
    cin >> X[i];
    AA[i] = upper_bound(X, X + i + 1, X[i] - A) - X;
    BB[i] = upper_bound(X, X + i + 1, X[i] - B) - X;
  }
 
  BinaryIndexedTree dp1(N), dp2(N);
  dp1.add(0, 1);
  dp2.add(0, 1);
  int aa = 0, bb = 0;
 
  for(int i = 1; i < N; i++) {
    int s = dp2.sum(AA[i]), t = dp1.sum(BB[i]);
    dp1.add(i, s);
    dp2.add(i, t);
    if(X[i] - X[i - 1] < A) 
      for(; aa < i; aa++) dp1.add(aa, mod - dp1.get(aa));
    if(X[i] - X[i - 1] < B)
      for(; bb < i; bb++) dp2.add(bb, mod - dp2.get(bb));
  }
 
  cout << (dp1.sum(N - 1) + dp2.sum(N - 1)) % mod << endl;
}

Measured memory_bytes: 3328
#include <vector>
#include <iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	int b = 1;
	while (b * 2 <= N) b *= 2;
	if (b == N) {
		cout << "No" << endl;
	}
	else if (N == 3) {
		cout << "Yes" << endl;
		cout << 1 << ' ' << 2 << endl;
		cout << 2 << ' ' << 3 << endl;
		cout << 3 << ' ' << 4 << endl;
		cout << 4 << ' ' << 5 << endl;
		cout << 5 << ' ' << 6 << endl;
	}
	else {
		cout << "Yes" << endl;
		cout << b << ' ' << 1 << endl;
		cout << 1 << ' ' << b + 1 << endl;
		cout << b + 1 << ' ' << b + N << endl;
		cout << b + N << ' ' << 1 + N << endl;
		cout << 1 + N << ' ' << b + 1 + N << endl;
		for (int i = 2; i < b - 1; ++i) {
			cout << i << ' ' << i + 1 << endl;
		}
		cout << b - 1 << ' ' << 1 + N << endl;
		for (int i = 1; i < b - 1; ++i) {
			cout << i + N << ' ' << i + 1 + N << endl;
		}
		vector<int> seq;
		for (int i = 2; i < b; ++i) {
			seq.push_back(i);
		}
		for (int i = 1; i < b; ++i) {
			seq.push_back(i);
		}
		vector<int> rui(seq.size());
		int d = seq.size() / 2;
		rui[d] = seq[d];
		for (int i = d - 1; i >= 0; --i) {
			rui[i] = rui[i + 1] ^ seq[i];
		}
		for (int i = d + 1; i < seq.size(); ++i) {
			rui[i] = rui[i - 1] ^ seq[i];
		}
		vector<int> pos(b * 2, -1);
		for (int i = 0; i < seq.size(); ++i) {
			pos[rui[i] ^ b] = i;
		}
		for (int i = 0; i <= N; ++i) {
			if (pos[i] != -1) {
				if (pos[i] < d) pos[i] += 2;
				else pos[i] -= d, pos[i] += 1, pos[i] += N;
			}
		}
		for (int i = b + 2; i <= N; ++i) {
			cout << i << ' ' << b + N << endl;
			cout << i + N << ' ' << pos[i] << endl;
		}
	}
	return 0;
}

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

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pii pair <int, int>
#define pll pair <ll, ll>
#define gcd __gcd
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"

const ll L = 1e5+5;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    ll A, B, C, D;
    cin >> A >> B >> C >> D;

    ll lcm = (C*D)/gcd(C, D);

    ll ans = 0;

    ans+=(B/C);
    ans-=((A-1)/C);

    ans+=(B/D);
    ans-=((A-1)/D);

    ans-=(B/lcm);
    ans+=((A-1)/lcm);

    cout << B-A+1-ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const ll mod = 1e9+7;

int n;

int main()
{
    cin >> n;
    vl t,a;
    t.resize(n); a.resize(n);
    rep(i,n) cin >> t[i] >> a[i];

    ll l = 1;
    ll r = 1;
    rep(i,n){
        ll kl,kr;
        kl = l/t[i]; kr = r/a[i];
        if(l%t[i] != 0) kl++;
        if(r%a[i] != 0) kr++;
        ll k = max(kl, kr);
        l = t[i]*k; r = a[i]*k;
    }
    cout << r+l << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repn(i,n) for(int i = 0; i <= (int)(n); i++)
#define srep(i,l,n) for(int i = l; i < (int)(n); i++)
#define srepn(i,l,n) for(int i = l; i <= (int)(n); i++)
#define drep(i,n) for(int i = (int)(n-1); i >= 0; i--)
#define drepn(i,n) for(int i = (int)(n); i >= 0; i--)
#define size(s) (int)s.size()
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<typename T> inline istream& operator>>(istream &i, vector<T> &v) {rep(j, size(v)) i >> v[j]; return i;}
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; }
template<class T> T gcd(T a, T b) {if(b==0)return a; else return gcd(b,a%b);}
template<class T> T lcm(T a, T b) {return a/gcd(a,b)*b;}
template<class T = int> using V = vector<T>;
template<class T = int> using VV = vector<V<T>>;
bool isIn(int i, int j, int h, int w) {return i >= 0 && i < h && j >= 0 && j < w;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define ep emplace_back

const int MOD = 1000000007;
const int INF = 1e9;

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m, x, y;
    cin >> n >> m >> x >> y;
    V<> a(n), b(m);
    cin >> a >> b;
    bool ans = false;
    srepn(i, x + 1, y) {
        bool ok = true;
        rep(j, n) if(a[j] >= i) ok = false;
        rep(j, m) if(b[j] < i) ok = false;
        if(ok) ans = true;
    }
    cout << (ans ? "No War" : "War") << endl;
}

Measured memory_bytes: 3640
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] a = new int[2];
		int[] b = new int[2];
		int[] c = new int[2];
		int[] d = new int[2];
		
		double x, y;
		while(sc.hasNext()){
			x = sc.nextDouble();
			y = sc.nextDouble();
			
			if(x>=1.1) a[0]++;
			else if(x>=0.6) b[0]++;
			else if(x>=0.2) c[0]++;
			else d[0]++;
			
			if(y>=1.1) a[1]++;
			else if(y>=0.6) b[1]++;
			else if(y>=0.2) c[1]++;
			else d[1]++;
		}
		
		System.out.println(a[0] + " " + a[1]);
		System.out.println(b[0] + " " + b[1]);
		System.out.println(c[0] + " " + c[1]);
		System.out.println(d[0] + " " + d[1]);
	}	
}

Measured memory_bytes: 20692
//#include "stdc++.h"
#include <bits/stdc++.h>
#include<iostream>
#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define pb push_back
#define flush fflush(stdout)
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define reset(x,v) memset(x,v,sizeof(x))
//#define sz(x) (int)(x.size())
#define ff first
#define ss second
#define endl "\n"
inline ll gcd(ll a,ll b){if(a==0) return b;return gcd(b%a,a);}
inline ll power(ll a,ll n,ll m){if(n==0)return 1;ll p=power(a,n/2,m);p=(p*p)%m;if(n%2) return (p*a)%m;else return p;}
const ll MOD =1000000007 ;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
#define pi 3.141592653589793238462
#define int  long long
int f[200001],inf[200001];
int C(int i,int j)
{
    int ans=f[i];
    ans=(ans%MOD*inf[j]%MOD)%MOD;
    ans=(ans%MOD*inf[i-j]%MOD)%MOD;
    return ans;
}
int32_t main()
{
    
    IOS;
    f[0]=1;
    for(int i=1;i<200001;i++)
        f[i]=(f[i-1]*i)%MOD;
    inf[200000]=power(f[200000],MOD-2,MOD);
    for(int i=200000-1;i>=0;i--)
        inf[i]=((i+1)*inf[i+1])%MOD;
    int h,n,w,x,y;
    cin>>h>>w>>n;
    pair<int,int> p[n];
    for(int i=0;i<n;i++)
    {
        cin>>p[i].first;
        cin>>p[i].second;
    }
    sort(p,p+n);
    int ways[n];
    for(int i=0;i<n;i++)
    {
        x=p[i].first;
        y=p[i].second;
        ways[i]=C(x+y-2,x-1);
        for(int j=0;j<i;j++)
        {
            if(p[j].second<=p[i].second)
            {
                ways[i]=(ways[i]%MOD-(ways[j]%MOD*C(x+y-(p[j].first+p[j].second),x-p[j].first)%MOD)%MOD+MOD)%MOD;
            }
        }
    }
    int ans=C(h+w-2,h-1);
    for(int i=0;i<n;i++)
    {
        ans=(ans-(ways[i]%MOD*C(h+w-(p[i].first+p[i].second),h-p[i].first)%MOD)%MOD+MOD)%MOD;
    }
    cout<<ans<<endl;
    return 0;
}




Measured memory_bytes: 3456
#include<stdio.h>
int main(){
  int a,b,c,score=0;
  scanf("%d%d%d",&a,&b,&c);
  while(a!=b){
    if(c%a==0)score=score+1;
    a=a+1;
}
  if(a==b && c%a==0){
    score=score+1;}
  printf("%d\n",score);
  return 0;
}

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

using namespace std;


#define uniq(x)  x.erase(unique(x.begin(),x.end()), x.end()) //Unique value find from vector
#define upper(arr,n,fixed) upper_bound(arr,arr+n,fixed)-arr  //Upper value search  >
#define lower(arr,n,fixed) lower_bound(arr,arr+n,fixed)-arr  //Lower value search  >=
#define FOR(i,a,n) for(int i=a; i<(int)n; i++)
#define FORI(i,a,n) for(int i=a; i>=(int)n; i--)
#define pii pair<int,int>
#define vpii vector<pii>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(a) int((a).size())
#define fastIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define endl "\n"
#define all(a) a.begin(), a.end()
#define MEMSET(p,i) memset(p,i,sizeof(p))

typedef long long LL;
typedef unsigned long long ULL;

ULL dp[110][100010] = {0};
int v[110];

ULL sum(int l, int x, int y)
{
	return x == 0 ? (dp[l][y]) : (dp[l][y] - dp[l][x-1]);
}

int main(void)
{
	fastIO();
	int n, k;

	cin >> n >> k;
	FOR(i,0,n)
		cin >> v[i];

	MEMSET(dp,0);
	FOR(i,0,(v[0]+1)){
		dp[0][i] = 1;
	}

	ULL MOD = 1000000007;
	// FOR(j,0,k+1)
	// 	cout << dp[0][j] << " "; cout << endl;
	FOR(i,0,n-1){
		// Soma prefixa da linha acima
		FOR(j,1,k+1)
			dp[i][j] += dp[i][j-1];
	
		FOR(j,0,k+1){
			int a = max(0, j-v[i+1]);
			int b = j;

			ULL s = sum(i, a, b);
			s %= MOD;
			dp[i+1][j] += s;
			dp[i+1][j] %= MOD;
			// cout << dp[i+1][j] << " ";
		}
		// cout << endl;
		
	}


	cout << dp[n-1][k] << endl;
	
}

Measured memory_bytes: 86272
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 9999999999;
template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
  T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }

int main() {
  int n,w; cin >>n >>w;
  vector<ll> weight(n), value(n);
  rep(i, n) cin >>weight.at(i) >>value.at(i);
  int max_v = 100000;
  vector<vector<ll>> dp(n+1, vector<ll>(max_v+1, MOD*2));
  dp.at(0).at(0) = 0;

  for (int i=0; i<n; i++){
    for (int j=0; j<=max_v; j++){
      chmin(dp.at(i+1).at(j), dp.at(i).at(j));
      if (dp.at(i).at(j)+weight.at(i)<=w) chmin(dp.at(i+1).at(j+value.at(i)), dp.at(i).at(j) + weight.at(i));
    }
  }
  ll ans = 0;
  for (int j=0; j<=max_v; j++){
    if (dp.at(n).at(j) <= w) ans = j;
  }

  cout <<ans <<endl;
}

Measured memory_bytes: 80256
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int subordinate_count[] = new int[n + 1];
        
        for (int i = 2; i <= n; i++) {
            subordinate_count[sc.nextInt()]++;
        }
        
        for (int i = 1; i <= n; i++) {
            System.out.println(subordinate_count[i]);
        }
    }
}


Measured memory_bytes: 70624
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#define vll vector<ll>
#define vvvl vector<vvl>
#define vvl vector<vector<ll>>
#define VV(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define VVV(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;

int main(int argc, char const *argv[]) {
  ll D;std::cin >> D;

  vll c(26);
  re(i, 26) std::cin >> c[i];

  vvl s = VV(D, 26, 0, ll);
  re(i, D) re(j, 26) std::cin >> s[i][j];
  vll t(D);re(i, D) std::cin >> t[i];

  vll cnt(26, 0);
  ll score = 0;
  for(int i=0;i<D;i++){
    ll idx = t[i] - 1;
    for(int j=0;j<26;j++){
      if(j==idx) cnt[j] = 0;
      else{
        cnt[j]++;
        score -= cnt[j]*c[j];
      }
    }
    score += s[i][idx];
    std::cout << score << '\n';
  }
  return 0;
}


Measured memory_bytes: 3256
#include <iostream>
#include <string>


using namespace std;

int K;
string S;

int main()
{
	cin >> K;
	cin >> S;

	string ans = S;
	if (S.length() > K) {
		ans = S.substr(0, K) + "...";
	}


	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  ll a[n],b[n];
  rep(i,n) cin >> a[i] >> b[i];
  ll c=0;
  for(int i=n-1;i>=0;i--){
    c+=ceil(((long double) (a[i]+c))/((long double) (b[i])))*b[i]-(a[i]+c);
  }
  cout << c << endl;


  
  return 0;
    

}


Measured memory_bytes: 2048
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dd;
const int N = 2e5+5;
const int maxn = 1e9+5;
const dd eps = 1e-6;
const ll mod = 1e9+7;

int n,d[15][15];
ll ans;

int main(){
  cin>>n;
  for(int i = 1;i <= n;i++){
    string now = to_string(i);
    int first = now[0] - '0';
    int last = now[now.size()-1] - '0';
    if(last) d[last][first]++;
  }
  for(int i = 1;i <= 9;i++){
    for(int j = 1;j <= 9;j++){
      if(i == j) ans += (ll)(d[i][i]*d[i][i]);
      else ans += (ll)(d[i][j]*d[j][i]);
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x,y;
    cin>>x>>y;
    for(int i=0;i<=x;i++){
        if(i*2+(x-i)*4==y){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    return 0;
}


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

ll f[1000050]={0};

int main()
{
    ll n,i,j;
    cin>>n;

    for(i=1; i<=n; i++)
    {
        f[i]++;
        for(j=2*i; j<=n; j+=i)
        {
            f[j]++;
        }
    }
    // for(i=1; i<=10; i++)
        // cout<<f[i]<<" ";

    ll a,b,c,res=0;;
    for(c=1; c<n; c++)
    {
        ll num=n-c;

        res+=f[num];
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 11408
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;

int main() {
  ll n, m;
  cin >> n >> m;

  ll ans = 0;
  if (n > 2 && m > 2) {
    ans = (n - 2) * (m - 2);
  } else if (n == 1 && m > 2) {
    ans = m - 2;
  } else if (m == 1 && n > 2) {
    ans = n - 2;
  } else if (n == 1 && m == 1) {
    ans = 1;
  } else if (n <= 2 && m <= 2) {
    ans = 0;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3632
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
#define endl '\n'
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7 ;
const ll N = 1e5 + 10 ;
int arr[100];

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

    return 0 ;
}

Measured memory_bytes: 256
alphabet = "abcdefghijklmnopqrstuvwxyz"


n = int(input())
res = dict()
ans = 0
for _ in range(n):
    s = str(input())
    s = "".join(sorted(s))
    if s not in res.keys():
      res[s] = 1
    else:
      ans += res[s]
      res[s] += 1
print(ans)
      

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

template <typename T> T load() { T r; cin >> r; return r; }
template <typename T> vector<T> loadMany(int n) { vector<T> rs(n); generate(rs.begin(), rs.end(), &load<T>); return rs; }

template <typename T, typename E> T qpow(T x, E e) {
    if (e == 1) return x;
    if (e % 2 == 0) return qpow(x*x, e/2);
    return x * qpow(x*x, e/2);
}

template <unsigned m> struct Mint {
    Mint():val(0){}
    Mint(int raw):val((raw%m+m)%m){}
    Mint(long long raw):val((raw%m+m)%m){}
    Mint(unsigned raw):val(raw%m){}
    Mint(unsigned long long raw):val(raw%m){}
    friend Mint operator+(Mint a, Mint b) { return a.val + b.val; }
    friend Mint operator-(Mint a, Mint b) { return m + a.val - b.val; }
    friend Mint operator*(Mint a, Mint b) { return 1ll * a.val * b.val; }
    friend Mint operator/(Mint a, Mint b) { return a * qpow(b, m-2); }
    friend Mint& operator+=(Mint& a, Mint b) { return a = a + b; }
    friend Mint& operator-=(Mint& a, Mint b) { return a = a - b; }
    friend Mint& operator*=(Mint& a, Mint b) { return a = a * b; }
    friend Mint& operator/=(Mint& a, Mint b) { return a = a / b; }
    friend bool operator==(Mint a, Mint b) { return a.val == b.val; }
    friend bool operator!=(Mint a, Mint b) { return a.val != b.val; }
    friend ostream& operator<<(ostream& out, Mint x) { return out << x.val; }
    unsigned val;
};

template <typename T> struct Mat {
    Mat(int w, int h, const T& def):w(w),h(h),data(w*h, def){}
    const T& at(int x, int y) const { return data[y*w+x]; }
    T& at(int x, int y) { return data[y*w+x]; }
    friend Mat operator*(const Mat& a, const Mat& b) {
        assert(a.w == b.h);
        auto c = Mat(b.w, a.h, 0);
        for (auto x=0; x<b.w; ++x)
            for (auto y=0; y<a.h; ++y)
                for (auto i=0; i<a.w; ++i)
                    c.at(x, y) += a.at(i, y) * b.at(x, i);
        return c;
    }
    int w, h;
    vector<T> data;
};

using M = Mint<1'000'000'000 + 7>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    auto n = load<int>();
    auto k = load<long long>();
    auto base = Mat<M>(n, n, 0);
    for (auto y=0; y<n; ++y)
        for (auto x=0; x<n; ++x)
            base.at(x, y) = load<int>();
    auto result = qpow(base, k);
    auto total = M(0);
    for (auto x=0; x<n; ++x)
        for (auto y=0; y<n; ++y)
            total += result.at(x, y);
    cout << total << '\n';
}


Measured memory_bytes: 896
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-03-25 17:15:35
*/

#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()
{
    int n, m;
    cin >> n >> m;

    int ans = n*(n-1)/2 + m*(m-1)/2;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
using System;

namespace AtCoder_20190218
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');

            int N = int.Parse(str[0]);
            int M = int.Parse(str[1]);

            bool[,] array = new bool[N, M + 1];

            for (int i = 0; i < N; i++)
            {
                string[] str2 = Console.ReadLine().Split(' ');
                int K = int.Parse(str2[0]);
                for (int j = 0; j < K; j++)
                {
                    int value = int.Parse(str2[j + 1]);
                    array[i, value - 1] = true;
                }
            }

            int count = 0;
            bool flag = true;
            for (int j = 0; j < M; j++)
            {
                for (int i = 0; i < N; i++)
                {
                    if (!array[i, j])
                    {
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    count++;
                }
                flag = true;
            }

            Console.WriteLine(count);
        }
        
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define repi(i,a,b) for(int i=a; i<=(b); ++i)
#define rrep(i,n) for(int i=(n-1); i>=0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define pr(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
#define yes "Yes"
#define no "No"
using namespace std;
using ll = long long;
using Edge = pair<int,long long>;
using Graph = vector<vector<Edge>>;
typedef pair<int,int> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int MOD = 1e9 + 7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int main(){
    int N;
    cin >> N;
    vector<int> L(N);
    rep(i,N) cin >> L[i];
    sort(ALL(L));
    int ans = 0;
    rep(a,N) rep(b,N) if(a < b){
        int kosu = lower_bound(ALL(L),L[a]+L[b]) - L.begin() - (b+1);
        if(kosu > 0) ans += kosu;
    }
    pr(ans);
}

Measured memory_bytes: 892
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
using namespace std;

#define X first
#define Y second
#define N 100010
#define M 500010

typedef long long ll;
const int INF=1ll<<30;

int n, m, cnt;
int a[N], b[N], c[N];

int main()
{
	//freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);
	
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
	b[1] = a[1]; m = 1;
	for (int i = 2; i <= n; ++i) if (a[i] != a[i - 1]) b[++m] = a[i];
	//for (int i = 1; i <= m; ++i) cout<<b[i]<<" ";
	//cout<<endl;
	int ans = 0; 
	for (int i = 2; i < m; ++i) if ((b[i] > b[i - 1]  && b[i] > b[i + 1]) || (b[i] < b[i - 1] && b[i] < b[i + 1]))  c[++cnt] = i ;
	
	c[++cnt] = n;
	for (int i = 1; i <= cnt; ++i) 
	{
		ans++;
	//	cout << i << " " << c[i-1] <<" " <<c[i]<<endl;
		if (i != 1 && c[i] == c[i - 1] + 1) ++i;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
using namespace std;
int32_t main(){
    int n,k;
    cin>>n>>k;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int dp[k+1];
    //0 represents 1st player looses and 1 represents 1st player wins
    dp[0]=0;
    for(int i=1;i<=k;i++){
        dp[i]=0;
        for(int j=0;j<n;j++){
            if(i-a[j]>=0 && dp[i-a[j]]==0){
                dp[i]=1;
            }
        }
    }
    if(dp[k]==1){
        cout<<"First"<<endl;
    }
    else{
        cout<<"Second"<<endl;
    }
    return 0;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[2][N];
  for(int i=0;i<2;i++){
    for(int j=0;j<N;j++) cin >> a[i][j];
  }

  //累積和
  int sum0[N+1];
  int sum1[N+1];
  sum0[0]=0;
  sum1[0]=0;
  for(int i=1;i<=N;i++){
    sum0[i] = sum0[i-1] + a[0][i-1];
    sum1[i] = sum1[i-1] + a[1][i-1];
  }

  int ans = 0;
  for(int i=0;i<N;i++){
    int tmp = 0;
    tmp += sum0[i+1];
    tmp += (sum1[N] - sum1[i]);
    ans = max(ans, tmp);
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256