akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef pair<double,double> PD;
typedef pair<int,P> ed;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
const double eps = 1e-10;
  
int main() {
  string s;
  cin >> s;
  deque<int> deq;
  rep(i,sz(s)) {
    deq.push_back(s[i]-'a');
  }
  bool n = true;
  int q;
  cin >> q;
  rep(qi,q) {
    int x;
    cin >> x;
    if(x==1) {
      n = !n;
      continue;
    }
    int f;
    char c;
    cin >> f >> c;
    if(f==1&&!n) {
      deq.push_back(c-'a');
    } else if(f==2&&n) {
      deq.push_back(c-'a');
    } else if(f==1&&n) {
      deq.push_front(c-'a');
    } else {
      deq.push_front(c-'a');
    }
  }
  if(!n) reverse(rng(deq));
  rep(i,sz(deq)){
    cout << (char)(deq[i]+'a');
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 1920
import java.awt.Point;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;


public class Main {
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		while(true){
			
			int t = sc.nextInt();
			int n = sc.nextInt();
			if(t == 0 && n == 0){
				break;
			}
			
			int[][] fault = new int[2][n];
			int[][] map = new int[200][200];
			boolean[][] reach = new boolean[200][200];
			int[][] move = {{1,1},{1,0},{0,-1},{-1,-1},{-1,0},{0,1}};
			
			for(int i = 0; i < 200; i++){
				for(int j = 0; j < 200; j++){
					map[j][i] = Integer.MAX_VALUE;
				}
			}
			
			for(int i = 0; i < n; i++){
				fault[0][i] = sc.nextInt();
				fault[1][i] = sc.nextInt();
				map[fault[0][i] + 100][fault[1][i] + 100] = -1;
			}
			
			int[] start = {sc.nextInt() + 100 , sc.nextInt() + 100};
			reach[start[0]][start[1]] = true;
			int count = 0;
			int x;
			int nextx;
			int y;
			int nexty;
			int size;
			Queue<Point> queue = new LinkedList<Point>();
			queue.offer(new Point(start[0], start[1]));
			while(true){
				if(count == t){
					break;
				}
				size = queue.size();
				for(int i = 0; i < size; i++){
					x = queue.peek().x; 
					y = queue.poll().y;
					for(int j = 0; j < move.length; j++){
						nextx = x + move[j][0];
						nexty = y + move[j][1];
						if(0 <= nextx && 0 <= nexty && nextx < 200 && nexty < 200 && map[nextx][nexty] != -1
								&& !reach[nextx][nexty]){
							reach[nextx][nexty]  = true;
							map[nextx][nexty] = count + 1;
							queue.offer(new Point(nextx, nexty));
						}
					}
				}
				count++;
			}
			int sum = 0;
			for(int i = 0; i < 200; i++){
				for(int j = 0; j < 200; j++){
					if(reach[j][i]){
						sum++;
					}
				}
			}
			System.out.println(sum);
			
		}
		
	}

}

Measured memory_bytes: 17000
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
#include <cmath>
#include <cstdio>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b))<EPS)

const double PI=4*atan(1.0);
typedef complex<double> P;

// àÏ
double dot(P a, P b) {
  return (a.real() * b.real() + a.imag() * b.imag());
}
// OÏ
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}
// a©çbÖ¶üèÅ½x©
double diffAngle(P a,P b){
  // cos>0&&sin>0 -> 0 -> 90
  // cos<0&&sin>0 -> 90->180
  // cos<0&&sin<0 -> 180->270
  // cos>0&&sin<0 -> 270 -> 359
    //double cosn=dot(a,b)/(abs(a)*abs(b));
    //double sinn=cross(a,b)/(abs(a)*abs(b));
    //double angle=acos(cosn);
    //if(sinn>0||EQ(sinn,0))
    //    return angle;
    //return 2*PI-angle;
    double angle=atan2(cross(a,b),dot(a,b));
    return angle;
}

int main(){
    int n;
    while(cin>>n&&n!=0){
        vector<P> points;
        for(int i = 0; i < n; i++){
            int x,y;
            cin>>x>>y;
            points.push_back(P(x,y));
        }
        vector<bool> isUsed(points.size(),false);
        double sum=0;
        P cp=P(0,1);
        P pp=P(0,0);
        int cnt=n;
        while(cnt--){
            int idx=-1;
            double minAngle=100000000;
            for(int i = 0; i < points.size(); i++){
                if(isUsed[i]) continue;
                double ca=diffAngle(points[i]-pp,cp);
              //  cout<<ca<<endl;
                if(EQ(minAngle,ca)){
                    if(abs(points[idx]-pp)>abs(points[i]-pp))
                        idx=i;
                }
                else if(minAngle>ca){
                    idx=i;
                    minAngle=ca;
                }
            }
            isUsed[idx]=true;
            double inc=abs(points[idx]-pp);
            sum+=inc;
            P p=(points[idx]-pp);
            cp=p/abs(p);
            pp=points[idx];
        }
        printf("%.1f\n",sum);
    }
    return 0;
}

Measured memory_bytes: 0
# -*- coding: utf-8 -*-
"""
http://tenka1-2017-beginner.contest.atcoder.jp/tasks/tenka1_2017_c

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    N = int(input())

    found = False
    for h in range(1, 3500+1):
        if found:
            break
        for n in range(1, h+1):
            try:
                w = h*n / (4*h*n/N - n - h)
            except ZeroDivisionError:
                continue
            if w > 0 and w == int(w):
                print(h, n, int(w))
                found = True
                break


if __name__ == '__main__':
    main(sys.argv[1:])
    


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i) 
const long long INF = 1000000007;
typedef long long ll;
using namespace std;
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; }
bool comp(pair<int, int> a, pair<int, int> b) {
	if (a.second != b.second) {
		return a.second < b.second;
	}
	else {
		return a.first < b.first;
	}
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	/*
	/
	/
	/
	*/
	ll n, k, q;
	cin >> n >> k >> q;
	ll temp = 0;
	vector<bool>ans(n, false);
	map<ll, ll>a;
	rep0(i, q) {
		cin >> temp;
		a[temp]++;
	}
	if (q - k >= 0) {
		for (auto& j : a) {
			if (q - k < j.second) {
				ans[j.first - 1] = true;
			}
		}	rep0(i, n) {
			if (ans[i] == true) {
				cout << "Yes" << endl;
			}
			else {
				cout << "No" << endl;
			}
		}
	}
	else {
		rep0(i, n) {
			cout << "Yes" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 4608
package main

import (
	"fmt"
	"math"
)

func main() {
	var d int
	fmt.Scan(&d)

	c := make([]int, 26)
	s := make([][]int, d)
	for i := 0; i <26; i++ {
		fmt.Scan(&c[i])
	}
	// 単純にmax Sを出してみる
	for i := 0; i < d; i++ {
		smax := 0
		maxI := 0
		slice := make([]int, 26)
		for j := 0; j < 26; j++ {
			fmt.Scan(&slice[j])
			if smax < slice[j] {
				smax = slice[j]
				maxI = j
			}
		}
		s[i] = slice
		fmt.Println(maxI+1)
	}

}


func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}


Measured memory_bytes: 2468
var
	N,K,i,p,q,x,tmp,get:Longint;
	ans,now,make:double;
begin
	read(N,K);
	if N>=K then begin
		ans:=(N-K+1)/N;
		q:=K-1;
	end
	else q:=N;
	make:=1;
	get:=1;
	for i:=1 to 0 do begin
		if q=0 then break;
		get:=get*2;
		make:=make*0.5;
		p:=K div get;
		if p<q then begin;
			ans:=ans+(q-p)/N*make;
			q:=p;
		end;
	end;
	for i:=q downto 1 do begin
		tmp:=(K+i-1)div i;
		x:=1;
		now:=1/N;
		while tmp>x do begin
			now:=now*0.5;
			x:=x*2;
		end;
		ans:=ans+now;
	end;
	writeln(ans:0:9);
end.

Measured memory_bytes: 128
/*input
red blue
5 5
blue
*/
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
using ll = long long;
using ld = long double;
using pii = pair<int,int>;
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
ll sub(ll a,ll b){
    ll x=a-b;
    while(x<0) x+=MOD;
    while(x>MOD) x-=MOD;
    return x;
}
ll mult(ll a,ll b){
    return a*b%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=(res*a)%MOD;
        a=(a*a)%MOD;
        b>>=1;
    }
    return res;
}
const int maxn=1e5+5;
int main(){
	string a,b,c;
	int d,e;
	cin>>a>>b>>d>>e>>c;
	if(c==a) --d;
	else --e;
	cout<<d<<' '<<e;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
using namespace std;
#define int long long int
#define double long double
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> new_data_set;
bool isprime(int n)
	{
    	if(n==1) return true;
    	for(int i = 2;i*i<=n;i++){
    		if(n%i==0) return false;
		}
		return true;
	}
int lcm(int a,int b){
	return (a*b)/__gcd(a,b);
}
int gcd(int a, int b) 
{ 
    if (b == 0){
    	return a;
	} 
    return gcd(b, a % b);  
      
} 
unsigned int factorial(unsigned int n) 
{ 
    if (n == 0) 
    return 1; 
    return n * factorial(n - 1); 
} 
const int inf=1e17+7;
int dsu[1000001],s[100005];
void init(int n,int m){
	for(int i=1;i<=n;i++){
		dsu[i]=i;
		s[i]=1;
	}
}
int root(int x){
	while(dsu[x]!=x){
		x = dsu[x];
	}
	return x;
}
void uni(int x,int y){
	int p = root(x);
	int q = root(y);
	if(p==q){
		return;
	}
	else{
		if(s[p]<s[q]){
			s[q]+=s[p];
			dsu[p] = q;
		}
		else{
			s[p]+=s[q];
			dsu[q] = p;
		}
	}
}
int power(int x, unsigned int y)  
{  
    int res = 1;
    x = x ; 
    if (x == 0) return 0;  
    while (y > 0){  
        if (y & 1)  
            res = (res);   
        y = y>>1;  
        x = (x*x);  
    }  
    return res;  
}
vector<int>graph[100001];
set<pair<int,int>>st;
char arr[1001][1001];
bool visit[1001][1001];
void dfs(int x,int y,int n,int m){
	st.erase({x,y});
	visit[x][y]=true;
	if(x<n-1 && arr[x+1][y]=='#' && !visit[x+1][y])dfs(x+1,y,n,m);
	if(x>0 && arr[x-1][y]=='#' && !visit[x-1][y])dfs(x-1,y,n,m);
	if(y<m-1 && arr[x][y+1]=='#' && !visit[x][y+1])dfs(x,y+1,n,m);
	if(y>0 && arr[x][y-1]=='#' && !visit[x][y-1])dfs(x,y-1,n,m);
}
signed main(){
	FAST
	int n;
	cin>>n;
	int arr[n+1];
	for(int i=1;i<=n;i++){
		cin>>arr[i];
	}
	if(n==1){
		cout<<arr[1];
		return 0;
	}
	if(n==2){
		cout<<max(arr[1],arr[2])-min(arr[1],arr[2]);
		return 0;
	}
	pair<int,int>dp[n+1][n+1];
	int i=1,j=1,cnt=1;
	while(i!=1 || j!=n){
		if(i==j){
			dp[i][j]={arr[i],0};
			i++;
			j++;
		}
		else{
			if(arr[i]+dp[i+1][j].second>arr[j]+dp[i][j-1].second){
				dp[i][j]={arr[i]+dp[i+1][j].second,dp[i+1][j].first};
			}
			else{
				dp[i][j]={arr[j]+dp[i][j-1].second,dp[i][j-1].first};
			}
			i++;
			j++;
		}
		if(i>n-cnt+1){
			i=1;
			cnt++;
			j=cnt;
		}
	}
	if(arr[i]+dp[i+1][j].second>arr[j]+dp[i][j-1].second){
		dp[i][j]={arr[i]+dp[i+1][j].second,dp[i+1][j].first};
	}
	else{
		dp[i][j]={arr[j]+dp[i][j-1].second,dp[i][j-1].first};
	}
	int ans=dp[1][n].first-dp[1][n].second;
//	for(int i=1;i<=n;i++){
//		for(int j=1;j<=n;j++){
//			cout<<dp[i][j].first<<" "<<dp[i][j].second<<"    ";
//		}
//		cout<<endl;
//	}
	cout<<ans;			
}

Measured memory_bytes: 145152
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }
    for (int i = 0; i < N; i++) {
        if (A[i] == 0) {
            cout << 0 << endl;
            return 0;
        }
    }

    ll ans = 1;
    for (int i = 0; i < N; i++) {
        if (A[i] > (ll)1e18 / ans) {
            cout << -1 << endl;
            return 0;
        }
        ans *= A[i];
    }
    if ((ll)1e18 < ans) {
        cout << -1 << endl;
        return 0;
    } else {
        cout << ans << endl;
        return 0;
    }
}


Measured memory_bytes: 4052
package main

import (
	"fmt"
	"math"
)

func mypow(a, n int) (b int) {
	b = 1
	for n > 0 {
		b *= a
		n--
	}
	return
}

func main() {
	var x int
	fmt.Scan(&x)
	v := 1
	for i := 2; i <= int(math.Sqrt(float64(x))); i++ {
		for j := 1; ; j++ {
			w := mypow(i, j)
			if w > x {
				break
			} else {
				if w > v {
					v = w
				}
			}
		}
	}
	fmt.Println(v)
}


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

int main(){

const int MAX_NO=100000;
int m[MAX_NO],f[MAX_NO],r[MAX_NO];
char hyouka[MAX_NO];
int a=0;

for(int i=1;i<MAX_NO;i++){

cin>>m[i]>>f[i]>>r[i];

a++;

if(m[i]==-1 && f[i]==-1 && r[i]==-1){
goto aa;
}

if(m[i]==-1 || f[i]==-1){
hyouka[i]='F';
}

else if((m[i]+f[i])>=80){
hyouka[i]='A';
}
else if((m[i]+f[i])>=65){
hyouka[i]='B';
}

else if((m[i]+f[i])>=50){
hyouka[i]='C';
}

else if((m[i]+f[i])>=30 && r[i]<50){
hyouka[i]='D';
}
else if((m[i]+f[i])>=30 && r[i]>=50){
hyouka[i]='C';
}

else if((m[i]+f[i])<30){
hyouka[i]='F';
}

}

aa:;

long long MX = 20000000;

for(int i=1;i<a;i++){

for(int j=1;j <= MX; j++)
{
for(int k = 1; k <= MX; k++) {
m[i] += 1;
m[i] -= 1;
}
}

cout<<hyouka[i]<<endl;

}

return 0;
}

Measured memory_bytes: 1172
N = gets.to_i
A = gets.chomp.split(" ").map(&:to_i).sort
B = gets.chomp.split(" ").map(&:to_i).sort
C = gets.chomp.split(" ").map(&:to_i).sort

t = Array.new(N)
tmp = 0
(N-1).downto(0){|i|
   idx = C.bsearch_index{|x| x > B[i]}
   wk = idx.nil? ? 0 : N - idx
   tmp += wk
   t[i] = tmp
}

puts A.inject(0){|r, a|
  wk = B.bsearch_index{|x| x > a}
  r + (wk.nil? ? 0 : t[wk])
}


Measured memory_bytes: 26812
#include<bits/stdc++.h>
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 2019;


int main() {
  string s;
  cin >> s;
  int n = s.size();
  reverse(s.begin(), s.end());
  ll mul = 1;
  vector<int> cnt(mod);
  int ans = 0;
  ll sum = 0;
  rep(i, n) {
    cnt[sum]++;
    (sum += (s[i] - '0') * mul) %= mod;
    ans += cnt[sum];
    (mul *= 10) %= mod; 
  }
  cout << ans << endl;
}

Measured memory_bytes: 3744
import java.util.*;
import static java.lang.Math.*;

public class Main {
	static int n;
	static int[] e, r;
	static Scanner sc = new Scanner(System.in);
	static final double EPS = 1.0e-8;
	
	static boolean read() {
		e = new int[3];
		for(int i = 0; i < 3; i++) e[i] = sc.nextInt(); 
		
		if(e[0] == 0 &&  e[1] == 0 && e[2] == 0) return false;
		n = sc.nextInt();
		r = new int[n];
		for(int i = 0; i < n; i++) {
			r[i] = sc.nextInt();
		}
		return true;
	}
	
	static void solve() {
		double a; double[] b = new double[3];
		boolean ok;
		for(int i = 0; i < 3; i++) b[i] = hypot(e[i], e[(i+1)%3]);
		for(int i = 0; i < n; i++) {		
			a = (double)r[i] * 2;
			ok = false;
			for(int j = 0; j < 3; j++) {
				if((a - b[j]) > EPS) {
					ok = true;
				}
			}
			if(ok) {
				System.out.println("OK");
			} else {
				System.out.println("NA");
			}
		}
	}
	public static void main(String[] args) {
		while(read()) {
			solve();
		}
	}
}

Measured memory_bytes: 12000
/*input
contest
sentence
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ld long double
#define pii pair<int,int>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define sz(_a) (ll)(_a.size())
#define FILL(n) memset(n,0,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
const ll maxn=200005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
 ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
    cin>>a>>b;
    map<char,vector<int>> mp;
    REP(i,a.length()){
        mp[a[i]].pb(i);
    }
    ll prv=-1,ans=0;

    REP(i,b.length()){
        if(mp[b[i]].empty()){
            cout<<-1;
            return 0;
        }
        auto x=upper_bound(ALL(mp[b[i]]),prv);
        if(x==mp[b[i]].end()){
            ++ans;
            prv=mp[b[i]][0];
        }
        else{
            prv=*x;
        }
    }
    cout<<ans*(ll)a.length()+prv+1;
}

Measured memory_bytes: 1228
#include <bits/stdc++.h>
 using namespace std;
 using pii = pair<int, int>;
 using ll = long long;
 #define rep(i, j, n) for(int i = j; i < (int)(n); i++)
 const ll MOD = 1000000007;
 const ll INFL = (1LL << 60);
 const int INFI = (1 << 30);

 int main() {
   int N; cin >> N;
   vector<ll> A(N);
   rep(i, 0, N) cin >> A.at(i);

   sort(A.begin(), A.end(), greater<ll>());

   priority_queue<int> pq;

   ll ans = 0;
   pq.push(A.at(0));
   rep(i, 1, N) {
     ll top = pq.top();
     pq.pop();
     ans += top;
     pq.push(A.at(i));
     pq.push(A.at(i));
   }

   cout << ans << endl;
 }


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

#define int long long

signed main() {
    int n, v;
    cin >> n;
    set<int> st;
    for(int i=0; i<n; i++){
        cin >> v;
        if(st.find(v)==st.end())
            st.insert(v);
        else
            st.erase(v);
    }
    cout << st.size() << endl;
    return 0;
}


Measured memory_bytes: 4864
#include<stdio.h>

int main(){
  int n;
  int a, b;

  scanf("%d", &n);

  if(n == 1){
    printf("Hello World\n");
  }else if (n==2){
    scanf("%d", &a);
    scanf("%d", &b);
    printf("%d\n", (a+b));
  }

  return 0;
}

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

int main(){
  int n,a=0,b=0,cnt=0;
  cin>>n;
  vector<int> p(n),q(n),v(n);
  rep(i,n) cin>>p[i];
  rep(i,n) cin>>q[i];
  rep(i,n) v[i]=i+1;
  bool bp,bq;
  do{
    cnt++;
    bp=true;
    bq=true;
    rep(i,n){
      if(v[i]!=p[i]) bp=false;
      if(v[i]!=q[i]) bq=false;
    }
    if(bp) a=cnt;
    if(bq) b=cnt;
  }while(next_permutation(ALL(v)));
  int ans=abs(a-b);
  cout<<ans<<endl;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a, b, c, d;
  long long int ans1, ans2, ans3, ans4;
  scanf("%d %d %d %d",&a, &b, &c, &d);
	ans1 = 1ll *max(a,b)*max(c,d);
	ans2 = 1ll *max(a,b)*min(c,d);
	ans3 = 1ll *min(a,b)*max(c,d);
	ans4 = 1ll *min(a,b)*min(c,d);
	printf("%lld",max(max(ans2,max(ans3,ans4)),ans1));
}

Measured memory_bytes: 3812
#include "bits/stdc++.h"

using namespace std;


struct unionfind
{
	//rankのオーバーフローに注意
	vector<int> par, rank;
	unionfind(int n)
	{
		par.resize(n);
		rank.resize(n);
		for (int i = 0; i < n; i++)
		{
			par[i] = i;
			rank[i] = 1;
		}
	}

	bool same(int u, int v)
	{
		return root(u) == root(v);
	}

	void unite(int u, int v)
	{
		u = root(u), v = root(v);
		if (u == v) return;
		if (rank[u] > rank[v]) swap(u, v);
		par[u] = v;
		rank[v] += rank[u];
	}

	int root(int v)
	{
		if (par[v] == v) return v;
		return par[v] = root(par[v]);
	}
};

void solve(void)
{
	int n, r, p;
	cin >> n >> r;
	unionfind uf(n);
	for (int i = 0; i < n; i++)
	{
		cin >> p;
		uf.unite(i, p-1);
	}
	vector<int> used(n), ws;
	for (int i = 0; i < n; i++)
	{
		if (used[uf.root(i)]) continue;
		ws.push_back(uf.rank[uf.root(i)]);
		used[uf.root(i)] = 1;
	}
	bitset<150010> dp;
	r = min(r, n - r);
	dp[0] = 1;
	for (int w : ws)
	{
		dp |= dp << w;
		if (dp[r])
		{
			cout << "Yes" << endl;
			return;
		}
	}
	cout << "No" << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}




Measured memory_bytes: 8392
#include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
#include <queue>
#include <math.h>
using namespace std;
#define N 10000000000000

int main(){
    long s, t;
    int a;
    cin>>s>>t;
    if (t-s>=2019){
        cout<<"0"<<endl;
    }
    else{
        int minnum=10000;
        for (int i=s; i<=t; i++){
            for (int j=s; j<=t; j++){
                if (i==j){
                    continue;
                }
                //a=(i*j)%2019;
                a=(i%2019)*(j%2019);
                a=a%2019;
                if (minnum>a){
                    minnum=a;
                }
            }
        }
        cout<<minnum<<endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define cint(d) scanf("%d", &d)
#define cint2(a, b) scanf("%d %d", &a, &b)
#define cint3(a, b, c) scanf("%d %d %d", &a, &b, &c)
#define cint4(a, b, c, d) scanf("%d %d %d %d", &a, &b, &c, &d)

#define clong(d) scanf("%lld", &d)
#define clong2(a, b) scanf("%lld %lld", &a, &b)
#define clong3(a, b, c) scanf("%lld %lld %lld", &a, &b, &c)
#define clong4(a, b, c, d) scanf("%lld %lld %lld %lld", &a, &b, &c, &d)

#define foreach(v, c) for(__typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define revforeach(v, c) for(__typeof( (c).rbegin()) v = (c).rbegin();  v != (c).rend(); ++v)
#define ALL(v) (v).begin(), (v).end()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second

typedef long long int slong;
typedef pair<int, int> pii;
typedef pair<slong, slong> pll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

#ifdef VSP4 
    #include "debug.h"    
#else
    #define debug(args...)                  // Just strip off all debug tokens
#endif

const int MOD = 1000000007;
#define MODSET(d) if ((d) >= MOD) d %= MOD;
#define MODNEGSET(d) if ((d) < 0) d = ((d % MOD) + MOD) % MOD;
#define MODADDSET(d) if ((d) >= MOD) d -= MOD;
#define MODADDWHILESET(d) while ((d) >= MOD) d -= MOD;

const int MAXN = 2e5;
const int SQRTN = 550;
const int LOGN = 60;
const int INT_INFINITY = 1001001001;
const int LIMIT = 1e6;

const slong LONG_INFINITY = 1001001001001001001ll;
const slong LONG_LIMIT = 800100100100101ll;

long long int power(int base, long long int exp, long long int mod = MOD)
{
	if (exp == 0)
	{
		return 1;
	}
	else
	{
		long long int ans;
		
		if (exp % 2)
		{
			ans = base*power(base, exp - 1, mod);
		}
		else
		{
			ans = power(base, exp/2, mod);
			ans *= ans;
		}
		
		if (ans >= mod)
		{
			ans %= mod;
		}
		
		return ans;
	}
}

slong fact[MAXN+5];

slong ncr(int n, int r)
{
	if (r > n)
	{
		return 0;
	}
	
	slong ans = fact[n];
	ans *= power(fact[r]*fact[n-r] % MOD, MOD-2);
	MODSET(ans);
	return ans;
}

int n;
int arr[MAXN+5];

int marked[MAXN+5];

int main()
{
	#ifdef VSP4
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	
	clock_t begin = clock();
	
	int t, i, j, l, r, k, x, type;
	
	cin >> n;
	
	int first = 0;
	int left = 0;
	
	for (i = 1; i <= n+1; i++)
	{
		cin >> arr[i];
		
		if (marked[arr[i]])
		{
			first = marked[arr[i]] - 1;
			//duplicate
			left = n+1 - i;
			debug(i, arr[i], left, first+left);
		}
		
		marked[arr[i]] = i;
	}
	
	fact[0] = 1;
	for (i = 1; i <= MAXN; i++)
	{
		fact[i] = i*fact[i-1] % MOD;
	}
	
	for (i = 1; i <= n+1; i++)
	{
		slong ans = ncr(n+1, i) - ncr(first+left, i-1);
		MODNEGSET(ans);
		cout << ans << "\n";
	}
	
	clock_t end = clock();
	double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
	
	cerr << elapsed_secs;
	
	return 0;
}


Measured memory_bytes: 3584
#include<bits/stdc++.h>
#define INF 100001
using namespace std;
inline int read()
{
	register int number_read=0,if_ok_read=1;
	char ch_read=getchar();
	while(ch_read<'0'||ch_read>'9')
	{
		if(ch_read=='-')
			if_ok_read=-1;
		ch_read=getchar();
	}
	while(ch_read>='0'&&ch_read<='9')
	{
		number_read=number_read*10+ch_read-'0';
		ch_read=getchar();
	}
	return number_read*if_ok_read;
}
inline void write(register int x_write)
{
    if(x_write<0)
	{
    	putchar('-');
		x_write=-x_write;
	}
    if(x_write>9)
		write(x_write/10);
    putchar(x_write%10+'0');
    return ;
}
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n=read(),l=read() ;
	string s[INF];
	for(int i=0;i<n;i++)
		cin>>s[i];
	sort(s,s+n);
	for(int i=0;i<n;i++)
		cout<<s[i];
	return 0;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define pb push_back
#define DEBUG false

using namespace std;

using ll = long long;
using P = pair<int,int>;
using Pl = pair<int,ll>;

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll LINF=1LL<<60;
const int MAX_N = 100005;
const ll lmod = 1e9+7;

int next(int pre,int now,const char &c){
  int res;
  if(!now){
    // now -> 'S'
    if(c=='o') res = pre;
    else res = pre^1;
  }else{
    // now -> 'W'
    if(c=='o') res = pre^1;
    else res = pre;
  }
  return res;
}

int main(){
  int N; string S;
  cin >> N >> S;
  map<int,string> mp;
  mp[0] = "S"; mp[1] = "W";
  rep(i,2) rep(j,2){
    int pre,now;
    pre = i; now = j;
    string ans = mp[i] + mp[j];
    rep(k,N-1){
      pre = next(pre,now,S[k+1]);
      if(k!=N-2) ans += mp[pre];
      swap(now,pre);
    }
    if(now==i&&next(j,i,S[0])==pre){
      cout << ans << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}

Measured memory_bytes: 3908
import java.util.*;
import java.io.*;
import java.text.DecimalFormat;

public class Main{
    public static void main(String[] args) throws Exception{
        new Main().run();
    }
    void run() throws Exception{
        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        boolean multiple = false;
        for(int tc = 1, tt = (multiple)?ni(in):1; tc<=tt; tc++)solve(in,out,tc);
        out.flush();
        out.close();
    }
    void solve(FastReader in, PrintWriter out, int TC) throws Exception{
        pn(out,negBase(ni(in), -2));
    }
    String negBase(int n, int b){
        if(n==0)return "0";
        String ans = "";
        while(n!=0){
            int rem = n%b;
            n /= b;
            if(rem<0){
                rem+= (-b);
                n++;
            }
            ans = rem+ans;
        }
        return ans;
    }
    void p(PrintWriter out, Object o){out.print(o);}
    void pn(PrintWriter out,Object o){out.println(o);}
    int ni(FastReader in){return Integer.parseInt(in.next());}
    long nl(FastReader in){return Long.parseLong(in.next());}
    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

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

        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }   
            return str;
        }
    }
} 


Measured memory_bytes: 23124
a= [input() for i in range(2)]
S=a[0]
T=a[1]

def CK(S,T):

    m=["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"]
    for a in range(len(m)):
        Sa=S+m[a]
        if(T == Sa):
            return True
            break
        else:
            a=a+1

reslt=CK(S,T)
# print(reslt)

if(reslt==True):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9076
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N = iIn()
A = iInLH()

den = 0
for i in range(N):
    den += 1.0 / A[i]
ans = 1.0 / den
print(ans)

Measured memory_bytes: 62352
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
	ll H,W;
	cin>>H>>W;
	int c[10][10];
	for(int i=0; i<10; i++){
		for(int j=0; j<10; j++){
			cin>>c[i][j];
		}
	}
	int a[H][W];
	for(int i=0; i<H; i++){
		for(int j=0; j<W; j++){
			cin>>a[i][j];
		}
	}
	for(int k=0; k<10; k++){
		for(int i=0; i<10; i++){
			for(int j=0; j<10; j++){
				c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
			}
		}
	}
	ll sum=0;
	for(int i=0; i<H; i++){
		for(int j=0; j<W; j++){
			if(a[i][j]!=-1){
				sum+=c[a[i][j]][1];
			}
		}
	}
	cout<<sum<<endl;
}

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

int main(){
  int n,s[1010],sum;
  double aa,ave;
  int i;

  while(1){
    aa=0;
    ave=0;
    sum=0;
    
    scanf("%d",&n);
    if(n==0) break;
    
    for(i=0;i<n;i++){
      scanf("%d",&s[i]);
      sum+=s[i];
    }
    ave=(double)sum/n;

    for(i=0;i<n;i++)
      aa+=(s[i]-ave)*(s[i]-ave);
    aa/=n;

    printf("%.8f\n",sqrt(aa));
  }
  return 0;
}

Measured memory_bytes: 1784
# -*- coding: utf-8 -*-
from sys import stdin

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()

D = d_in()

cand = ['Christmas']
cand.extend(['Eve'] * (25 - D))
ans = ' '.join(cand)
print(ans)


Measured memory_bytes: 2940
{-# LANGUAGE FlexibleInstances    #-}
{-# LANGUAGE TypeSynonymInstances #-}

import           Control.Applicative
import           Control.DeepSeq
import           Control.Monad
import           Control.Monad.ST
import qualified Data.Array                  as A
import qualified Data.Array.IArray           as IA
import qualified Data.Array.IO               as AI
import qualified Data.Array.MArray           as MA
import qualified Data.Array.ST               as STA
import qualified Data.Array.Unboxed          as AU
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import qualified Data.Graph                  as G
import           Data.Int
import qualified Data.IntMap                 as IM
import qualified Data.IntSet                 as IS
import           Data.List
import qualified Data.Map.Strict             as M
import           Data.Maybe
import           Data.Ord
import qualified Data.Sequence               as SQ
import qualified Data.Set                    as S
import           Data.Time
import qualified Data.Tree                   as T
import qualified Data.Vector                 as V
import qualified Data.Vector.Mutable         as VM
import qualified Data.Vector.Unboxed         as VU
import qualified Data.Vector.Unboxed.Mutable as VUM

readInt :: IO [Int]
readInt = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

readInts :: Int -> IO [[Int]]
readInts n = replicateM n readInt

readInteger :: IO [Integer]
readInteger = map (fst . fromJust . BS.readInteger) . BS.words <$> BS.getLine

readIntegers :: Int -> IO [[Integer]]
readIntegers n = replicateM n readInteger

readString :: IO [String]
readString = map BS.unpack . BS.words <$> BS.getLine

readStrings :: Int -> IO [[String]]
readStrings n = replicateM n <$> readString

toPair :: [a] -> (a, a)
toPair [x, y] = (x, y)

count :: Eq a => a -> [a] -> Int
count a as = length $ filter (== a) as

put :: Show a => a -> IO ()
put = putStr . show

putLn :: Show a => a -> IO ()
putLn = print

putList :: Show a => [a] -> IO ()
putList [n] = put n
putList (n:ns) = do
  put n
  putStr " "
  putList ns

putStrList :: [String] -> IO ()
putStrList [n] = putStr n
putStrList (n:ns) = do
  putStr n
  putStr " "
  putStrList ns

yesNoUpper b
  | b = putStrLn "YES"
  | otherwise = putStrLn "NO"

yesNo b
  | b = putStrLn "Yes"
  | otherwise = putStrLn "No"

main = do
  [x, t] <- readInt
  if x < t
    then put 0
    else put $ x - t


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


using namespace std;

int main()
{
	int n, t[100], m, p[100], x[100], tmp,ans=0;
	cin >> n;
	for (int i = 0; i <n; i++)
	{
		cin >> t[i];
	}
	cin >> m;
	for (int i = 0; i <m; i++)
	{
		cin >> p[i] >> x[i];
	}
	for (int i = 0; i <m; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (p[i]==j+1)
			{
				tmp = x[i];
				ans += tmp;
			}
			else
			{
				ans += t[j];
			}
		}
		cout << ans << endl;
		ans = 0;
	}
	    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int H, W;
    while ( true ){
        cin >> H >> W;
        if (H == 0 && W == 0){
            break;
        }
        for (int j = 0; j < W; j++){
            cout << '#';
        }
        cout << endl;
        for(int i = 1; i < H-1; i++){
            cout << '#';
            for (int j = 1; j < W-1;j++){
                cout << '.';
        }
        cout << '#' << endl;
        }
        for (int j = 0; j < W; j++){
            cout << '#';
        }
        cout << endl << endl;
    }
    
}//ITP_5_B*


Measured memory_bytes: 3092
#include<set>
#include<map>
#include<ctime>
#include<stack>
#include<queue>
#include<cmath>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
int read(){
    int f=1,x=0;char s=getchar();   
    while(s<'0'||s>'9'){if(s=='-')f=-1;s=getchar();}  
    while(s>='0'&&s<='9'){x=x*10+s-'0';s=getchar();}
    return x*f;
}
inline void print(int x){
	if(x<0) putchar('-'),x=-x;
	if(x>9)
		print(x/10);
	putchar(x%10+'0');
	return ;
}
#define INF 0x3f3f3f3f
#define MAXN 1000000
int main(){
	int a=read();
	if(a<1200)
		printf("ABC\n");
	else if(a<2800)
		printf("ARC\n");
	else 
		printf("AGC\n");
	return 0;
}

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

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

    if(K % 2 == 0)
        cout << (K / 2) * (K / 2) << endl;
    else 
        cout << ((K / 2) + 1) * (K / 2) << endl;


}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <bitset>
#include <cstdlib>
#include <cmath>
#include <set>
#include <list>
#include <deque>
#include <map>
#include <queue>
#include <fstream>
#include <cassert>
#include <cmath>
#include <sstream>
#include <time.h>
#include <complex>
#include <iomanip>

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef pair<double,double> dd;
typedef pair<char,char> cc;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> l4;
const double eps = 0.005;
const int maxn = 300010;
const ll mod = 1e9+7;

int n;
int a[maxn];
int main() {
    scanf("%d",&n);
    for (int i = 0; i < 3*n; i++) {
        scanf("%d",&a[i]);
    }
    sort(a,a+3*n,greater<int>());
    ll ans = 0;
    for (int i = 1; i < 2*n; i+=2) {
        ans += a[i];
    }
    printf("%lld",ans);
}





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

#define REP(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define REPS(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define RREP(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define RREPS(i, n) for (int i = ((int)(n)); i > 0; i--)
#define IREP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define IREPS(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVISORT(v) sort(v.begin(), v.end(), greater<int>());
#define ALL(v) v.begin(), v.end()
#define MP(n, m) make_pair(n, m);
#define COUT(d) cout<<std::setprecision(10)<<d<<endl;
#define CIN(n) getline(cin,n);

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using ll = long long;
using ul = unsigned long;

typedef long long ll;

template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

const int mod=1e9+7;


void printv(VI& v){
  REP(i,v.size()) cout << v[i] << " ";
  cout << endl;
}

int vtotal(VI& v){
  int total=0;
  REP(i,v.size()) total+=v[i];
  return total;
}

int main()
{
  cin.tie( 0 );
  ios::sync_with_stdio( false );
	
  //init(); // mint初期化

  ll a,b,t;
  cin>>a>>b>>t;

  ll ans=(t/a)*b;

  cout<<ans<<endl;
  

  // REP(i,n){
  //   REP(j,)
  // }

  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define PRECISION(x) cout << fixed << setprecision(x)
#define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define ALLR(X) (X).rbegin(), (X).rend()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second

using namespace std;
 
template<class T> void max_self(T & a, const T & b) { if(a < b) a = b; }
template<class T> void min_self(T & a, const T & b) { if(a > b) a = b; }
typedef long long LL;
const int INF = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = (1e-9);

int N;

int main(){
  FAST_IO
  N = 0;
  for(int rep = 0; rep < 4; ++rep){
    char op;
    cin >> op;
    if(op == '+') N++;
    else N--;
  }

  cout << N << '\n';
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int j=0, H, A;
        H = scan.nextInt();
        A = scan.nextInt();
        while(H>0)
        {
            H=H-A;
            j++;
        }
        System.out.println(j);

    }
}

Measured memory_bytes: 22612
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <random>
#include <queue>

using namespace std;


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

	vector<pair<int ,int>> As;

	int a;
	for(int ni = 0; ni < N; ni++){
		cin >> a;
		As.push_back(make_pair(abs(a), a));
	} 

	sort(As.rbegin(), As.rend());

	int flag = 1;
	long long sum = 0;
	for(int ni = 0; ni < N-1; ni++){
		if (flag * As[ni].second < 0) {
			flag = -1;
		}
		else {
			flag = 1;
		}
		sum += abs(As[ni].second);
	}

	sum += flag * As[N - 1].second;

	printf("%lld", sum);

	return 0;
}



Measured memory_bytes: 1400
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

S = input()
# 2通り試せばいい
# 最初を0にするか1にするか
current = '0'
ans1 = 0
for s in S:
    if s == current:
        if current == '0':
            current = '1'
        else:
            current = '0'
    else:
        # 塗り直し
        if current == '0':
            current = '1'
        else:
            current = '0'
        ans1 += 1

current = '1'
ans2 = 0

for s in S:
    if s == current:
        if current == '0':
            current = '1'
        else:
            current = '0'
    else:
        # 塗り直し
        if current == '0':
            current = '1'
        else:
            current = '0'
        ans2 += 1

print(min(ans1, ans2))


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

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			inCnt++;
			String[] se = s.split(" ");
			int h = Integer.valueOf(se[0]);
			int w = Integer.valueOf(se[1]);
			if (h == 0 && w == 0)
				break;
			doMain(inCnt, h, w);
		}
		System.exit(0);
	}

	private static void doMain(int inCnt, int h, int w) {
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++)
				if ((i + j) % 2 == 0)
					System.out.print("#");
				else
					System.out.print(".");
			System.out.println("");
		}
		System.out.println("");
	}
}

Measured memory_bytes: 31472
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

const ll N_MAX = 51;
ll COM[N_MAX];

void init(int n){
  COM[0] = 1;
  rep(i,n){
    COM[i+1] = COM[i]*(n-i)/(i+1);
  }
}

ll comb(int k){
  return COM[k];
}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int N,A,B;cin >> N >> A >> B;
  vector<double> v(N);
  rep(i,N)cin >> v[i];
  sort(all(v),greater<double>());
  double sum = 0;
  rep(i,A) sum += v[i];
  double max = (double) sum/A;
  cout << max << endl;

  double XX = v[A-1];
  sort(all(v));
  int usecount = upper_bound(v.begin()+N-A,v.end(),XX) - lower_bound(v.begin()+N-A,v.end(),XX);
  int count = upper_bound(all(v),XX) - lower_bound(all(v),XX);

  ll num = 0;
  init(count);
  if(XX==max){
    repp(k,usecount,min(B+1,A+1+count-usecount)){
      num += comb(k);
    }
  }else num = comb(usecount);

  cout << num << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <tuple>
#include <cmath>
#define rep(i, n) for(i = 0; i < (n); i++)
#define int long long
using namespace std;

int n;
int b[100];

signed main() {
	int i;
	
	cin >> n;
	rep(i, n - 1) cin >> b[i];
	
	int ans = 0;
	rep(i, n - 1) {
		ans += min(b[i], b[i + 1]);
	}
	ans += b[0] + b[n - 2];
	cout << ans << endl;
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)

template <class T>
T next()
{
    T x;
    cin >> x;
    return (x);
}

int main()
{
    auto N = next<int>();
    vector<int> h(N);
    rep(i, N) { cin >> h[i]; }
    int cnt = 0;

    while (h.size() > 0)
    {
        int i = h.size() - 1;
        bool flg = false;
        while (i >= 0 && h[i] > 0)
        {
            h[i]--;
            i--;
            flg = true;
        }
        cnt += flg ? 1 : 0;
        if (h[h.size() - 1] == 0)
        {
            h.pop_back();
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
from collections import Counter
n = int(input())
l = list()
for i in range(1,101):
    l.append((i, i**2))
# print(l)
c = Counter()
for X in l:
    for Y in l:
        for Z in l:
            x = X[0]
            y = Y[0]
            z = Z[0]
            c[X[1]+Y[1]+Z[1]+x*y+y*z+x*z] += 1

for i in range(1, n+1):
    print(c[i])


Measured memory_bytes: 11848