akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <vector>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <ctype.h>
#include <climits>
#include <queue>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)(n); ++i)
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;}

int main(){
	int h,w;
	cin >> h >> w;
	vector<string> s(h);
	REP(i,h) cin >> s[i];
	
	vector<vector<int>> hori(h,vector<int>(w,0)),vert(h,vector<int>(w,0));
	REP(i,h){
		int count=1;
		REP(j,w){
			if(s[i][j]=='.'){
				hori[i][j] = count;
				count++;
			}else if(s[i][j]=='#'){
				count=1;
			}
		}
	}
	REP(j,w){
		int count=1;
		REP(i,h){
			if(s[i][j]=='.'){
				vert[i][j] = count;
				count++;
			}else if(s[i][j]=='#'){
				count=1;
			}
		}
	}
	
	for(int i=h-1; i>=0; i--){
		int now=0;
		for(int j=w-1; j>=0; j--){
			if(hori[i][j]!=0){
				if(now==0){
					now = hori[i][j];
				}else{
					hori[i][j] = now;
				}
			}else{
				now = 0;
			}
		}
	}
	for(int j=w-1; j>=0; j--){
		int now=0;
		for(int i=h-1; i>=0; i--){
			if(vert[i][j]!=0){
				if(now==0){
					now = vert[i][j];
				}else{
					vert[i][j] = now;
				}
			}else{
				now = 0;
			}
		}
	}
	
	int ans=0;
	REP(i,h){
		REP(j,w){
			chmax(ans, hori[i][j]+vert[i][j]-1);
		}
	}
	
	cout << ans << endl;
	
	
	return 0;
}

Measured memory_bytes: 42308
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))

"""
def dec2bin(n):
    amari = [[] for j in range(2**n)]
    for i in range(2**n):
        while i != 0:
            amari[i].append(i%2)
            i = i // 2
        if len(amari[i]) != n:
            while len(amari[i]) < n:
                amari[i].append(0)
        amari[i].reverse()
    return amari
"""
def dec2bin(target):
    amari = []
    while target != 0:
        amari.append(target % 2)
        target = target //2
    if len(amari)!=n:
        while len(amari)<n:
            amari.append(0)
    amari.reverse()
    return amari

b = [[] for i in range(2**n)]
for j in range(2**n):
    b[j] = dec2bin(j)


vc = 0
for i in range(2**n):
    vsum = 0
    csum = 0
    for j in range(n):
        if b[i][j] == 1:
            vsum += v[j]
            csum += c[j]
    if vc <= vsum - csum:
        vc = vsum - csum
print(vc)

Measured memory_bytes: 326116
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <fstream>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
const double PI = 3.1415926535897932;   // acos(-1)
const double EPS = 1e-15;
const int mod = 1e+9 + 7;
const int INF = 1e+9;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    string s, t;
    cin >> s >> t;
    t += s;
    cout << t << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int M = scan.nextInt();
        int X = scan.nextInt();
        int Y = scan.nextInt();
        int max_x = Integer.MIN_VALUE;
        for (int i = 0; i < N; i++) {
            int x = scan.nextInt();
            if (max_x < x) {
                max_x = x;
            }
        }
        int min_y = Integer.MAX_VALUE;
        for (int i = 0; i < M; i++) {
            int y = scan.nextInt();
            if (y < min_y) {
                min_y = y;
            }
        }
        boolean answer = false;
        for (int Z = X + 1; Z <= Y; Z++) {
            if (max_x < Z && Z <= min_y) {
                answer = true;
                break;
            }
        }
        System.out.println(answer ? "No War" : "War");
    }
}


Measured memory_bytes: 23764
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;

void Main()
{
	int N, K, R, S, P;
  	cin >> N >> K >> R >> S >> P;
  	string T;
  	cin >> T;
  	vector<int> data(N);
  	rep(i,N){
    	if(T[i] == 'r') data[i] = P;
      	if(T[i] == 's') data[i] = R;
      	if(T[i] == 'p') data[i] = S;
    }
  	ll ans = 0;
  	int flag;
	rep(j,K){
      	flag = 0;
		for(int i = j; i<N; i+=K){
      		if(i<K){
          		ans += data[i];
        		//cout << i << ": " << ans << endl;
        	}
      		else{
          		if(T[i] == T[i-K]){
              		if(flag == 1) ans += data[i];
                	flag = (flag+1)%2;
                	//cout << i << ": " << ans << endl;
            	}
          		else{
            		ans += data[i];
              		flag = 0;
                	//cout << i << ": " << ans << endl;
            	}
        	}    
        }
    }
  
    cout << ans << endl;       
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

Measured memory_bytes: 848
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <climits>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <map>
#include <tuple>
#include <deque>
#include <set>
#include <functional>
#include <memory>
#include <stack>
#include <numeric>
#include <cfloat>
#include <bitset>
template<typename F>
int upper_bound(int from, int until, const F& predicate) {
	while (from < until) {
		const auto mid = (from + until) / 2;
		if (predicate(mid)) until = mid;
		else from = mid + 1;
	}
	return until;
}
int main() {
	int n, k; std::cin >> n >> k;
	std::vector<int> cards(n); for (auto& c : cards) std::cin >> c;
	std::sort(cards.begin(), cards.end());
	std::vector<bool> memo(k, false);
	std::cout << upper_bound(0, n, [&memo, &cards, k, n](const int ci) {
		const auto card = cards[ci];
		if (card < k) {
			std::fill(memo.begin(), memo.end(), false); memo[0] = true;
			auto is_need = false;
			for (auto i = 0; i < n && !is_need; ++i) if (i != ci) {
				for (int j = k - cards[i] - 1; j >= 0; --j) if (memo[j]) {
					memo[j + cards[i]] = true;
					if (j + cards[i] + card >= k) {
						is_need = true;
						break;
					}
				}
			}
			return is_need;
		}
		else {
			return true;
		}
		}) << std::endl;
}

Measured memory_bytes: 256
program atcoder_contest_scheduling
  implicit none
  integer, parameter :: maxday = 365, maxtype = 26
  integer :: d, c(maxtype), s(maxtype, maxday), t(maxday), u(maxday)
  integer :: m, n, p, i
  real(8) :: t1, t2
  call cpu_time(t1)
  call random_seed_clock()
  read(*,*) d
  read(*,*) c
  read(*,*) (s(:, i), i = 1, d)
  t = (/(maxloc(s(:, i), 1), i = 1, d)/)
  m = score()
  u = t
  do
    p = next_int(d)
    do i = 1, maxtype
      t(p) = i
      n = score()
      if (m < n) then
        m = n
        u(p) = i
      else
        t(p) = u(p)
      end if
      call cpu_time(t2)
      if (t2 - t1 > 1.979d0) goto 100
    end do
  end do
  100 write(*,'(i0)') (u(i), i = 1, d)
contains
  integer function score() result(res)
    integer :: last(maxtype), i
    last = 0
    res = 0
    do i = 1, d
      last(t(i)) = i
      res = res + s(t(i), i) + sum(c * (last - i))
    end do
  end
  subroutine random_seed_clock()
    integer :: nseed, clock
    integer, allocatable :: seed(:)
    call system_clock(clock)
    call random_seed(size = nseed)
    allocate(seed(nseed))
    seed = clock
    call random_seed(put = seed)
    deallocate(seed)
  end
  integer function next_int(m) result(res)
    integer, intent(in)  :: m
    real(8) :: r
    call random_number(r)
    res = int(m * r) + 1
  end
end program atcoder_contest_scheduling

Measured memory_bytes: 3008
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stdlib.h>
#include<cassert>
using namespace std;
const long long mod=998244353;
const long long inf=mod*mod;
const long long d2=500000004;
const double EPS=1e-10;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
int p[210];
int q[210];
vector<pair<int,int> > mr;
int N;
void wolf(int a){
    for(int i=a;i<N;i++)swap(p[i],p[i-a]);
   // printf("%d: ",a);
    for(int i=0;i<N;i++){
       // if(i)printf(" ");
     //   printf("%d",p[i]);
    }
   // printf("\n");
}
int main(){
    int a;scanf("%d",&a);
    N=a;
    for(int i=0;i<a;i++){scanf("%d",p+i);}
    for(int i=0;i<a;i++)q[i]=p[i];
    for(int i=0;i<a;i++){
        for(int j=1;j<a;j++){
            if(q[j]<q[j-1]){
                mr.push_back(make_pair(j-1,j));
                swap(q[j],q[j-1]);
            }
        }
    }
    vector<int>ret;
    int ori=0;
    for(int i=0;i<mr.size();i++){
        int L=mr[i].first;
        int rem=(L+1-ori+a)%a;
        while(rem){
            int mv=min(rem,1);
            ret.push_back(mv);
            wolf(mv);
            rem-=mv;
        }
        ret.push_back(a-1);
        wolf(a-1);
        ori=(L+1)%a;
 
    }
    int rem=(a-ori)%a;
    while(rem){
        int mv=min(rem,1);
        ret.push_back(mv);
        wolf(mv);
        rem-=mv;
    }
    assert(ret.size()<=100000);
    printf("%d\n",ret.size());
    for(int i=0;i<ret.size();i++){
        printf("%d\n",ret[i]);
    }
}

Measured memory_bytes: 892
#include "iostream"
using namespace std;

int main()
{

	
	while (1){
		
		int m, f, r;
		cin >> m >> f >> r;

		int sum = m+f;

		if (m == -1 && f == -1 && r == -1) break;

		if (m == -1 || f == -1){
			cout << "F" << endl;
		}else{
			if (sum >= 80){
				cout << "A" << endl;
			}

			if (sum >= 65 && sum < 80){
				cout << "B" << endl;
			}

			if (sum >= 50 && sum < 65){
				cout << "C" << endl;
			}

			if (sum >= 30 && sum < 50){

				if (r >= 50){
					cout << "C" << endl;
				}
				else{
					cout << "D" << endl;
				}

			}
			if (sum < 30){
				cout << "F" << endl;
			}


		}
		/* 入力された点数に対する処理... */


	}

	return 0;
}


Measured memory_bytes: 3112
import std.stdio;
import std.algorithm;
import std.conv;
import std.string;

void main() {
    auto n = readln.chomp.to!(long);
    auto t = readln.split.to!(long[]);
    auto m = readln.chomp.to!(long);
    long[] p;
    long[] x;
    long s = sum(t);

    foreach (i; 0..m){
        auto px = readln.split.to!(ulong[]);
        (s - t[px[0] - 1] + px[1]).writeln;
    }
}


Measured memory_bytes: 256
X,Y,Z,K = map(int, input().split())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
C = [int(a) for a in input().split()]

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

import heapq

h = [[-A[0]-B[0]-C[0], 0, 0, 0]]
L = []
for _ in range(K):
    t = heapq.heappop(h)
    a = t[1]
    b = t[2]
    c = t[3]
    print(-t[0])
    if a+1 < X and [a+1, b, c] not in L:
        heapq.heappush(h, [-A[a+1]-B[b]-C[c], a+1, b, c])
        L.append([a+1, b, c])
    if b+1 < Y and [a, b+1, c] not in L:
        heapq.heappush(h, [-A[a]-B[b+1]-C[c], a, b+1, c])
        L.append([a, b+1, c])
    if c+1 < Z and [a, b, c+1] not in L:
        heapq.heappush(h, [-A[a]-B[b]-C[c+1], a, b, c+1])
        L.append([a, b, c+1])

Measured memory_bytes: 4720
#!/usr/bin/env python

if __name__ == '__main__':
    n, m, l = map(int, raw_input().split())

    A = [map(int, raw_input().split()) for _ in range(n)]
    B = [map(int, raw_input().split()) for _ in range(m)]

    for i in range(n):
        print ' '.join(map(str, [sum([A[i][k]*B[k][j] for k in range(m)]) for j in range(l)]))



Measured memory_bytes: 5096
#include<bits/stdc++.h>
using namespace std;
int n,a[4];
int l[10];
int ans = 1e9;
void dfs(int depth,string s){
    if(depth == n){
        int len[5]{};
        int cnt[5]{};
        int cost = 0;
        for(int i = 0;i < n;i++){
            int x = (int)(s[i] - '0');
            len[x] += l[i];
            cnt[x]++;
        }
        for(int i = 1;i <= 3;i++){
            if(cnt[i] == 0)return;
            cost += (cnt[i] - 1) * 10;
            cost += abs(len[i] - a[i]);
        }
        if(ans > cost)ans = cost;
        return;
    }
    for(int i = 0;i < 4;i++){
        dfs(depth+1, s + (char)('0' + i));
    }
}
int main(){
    cin >> n >> a[1] >> a[2] >> a[3];
    for(int i = 0;i < n;i++)cin >> l[i];
    dfs(0,"");
    cout << ans << endl;
}

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

typedef long long ll;

int main() {
    ll n;
    cin >> n;
    ll cur_max = 0;
    ll ans = 0;
    for (ll i = 0; i < n; i++) {
        ll a;
        cin >> a;
        if (cur_max < a) {
            cur_max = a;
        } else {
            ans += cur_max - a;
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3592
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;

int K, N;

int t[100005];
long long int d[100005];

int C[100005];
vector<pair<long long int, int> > V;

multiset<pair<long long int, int> > S;

int main(void) {

	cin >> N >> K;
	for (int i = 1; i <= N; i++) {
		cin >> t[i] >> d[i];
	}

	for (int i = 1; i <= N; i++) {
		V.push_back(pair<long long int ,int> (d[i], t[i]));
	}

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

	/*for (int i = 0; i < N; i++) {
		cout << "d= " << V[i].first << "  t= " << V[i].second << endl;
	}*/

	long long int num = 0;
	long long int sum = 0;
	for (int i = 0; i < K; i++) {
		long long int D = V[i].first;
		int K = V[i].second;
		sum += D;
		if (C[K] == 0) { num++; C[K]++; }
		else { C[K]++;  S.insert(V[i]); }
	}

	long long int ans = 0;
	ans = sum + num*num;

	//cout << "sum= " << sum << " num= " << num << " ans= " << ans << endl;

	for (int i = K; i < N; i++) {
		//cout << "size= " << S.size() << endl;
		if (S.size() == 0) { break; }
		auto it = S.begin();
		//it++;
		long long int D = (*it).first;
		int K = (*it).second;


		//cout << "D= " << D << " K= " << K << endl;

		sum -= D;
		C[K]--; if (C[K] == 0) { num--; }
		 S.erase(it); 

		D = V[i].first;
		K = V[i].second;
		//cout << "D= " << D << " K= " << K << endl;
		sum += D;
		if (C[K] == 0) { num++; C[K]++; }
		else { C[K]++; S.insert(V[i]); }
		 //cout << "sum= " << sum << " num= " << num << " ans= " << ans << endl;
		ans = max(ans, sum + num*num);
	}


	cout << ans << endl;
	//system("pause");
	return 0;
}

Measured memory_bytes: 6256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
constexpr long long LINF = 1001001001001001001;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
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; }


int main(){
    double L; cin >> L;
    double num = L / 3;
    cout << fixed << setprecision(12);
    cout << num * num * num << ln;
}

Measured memory_bytes: 3720
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)

using namespace std;

typedef long long ll;

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

int main(){

    int N;

    cin >> N;
    int Test=0;
    vector<string> S_(N);
    vector<string> Co_str;
    vector<int> Co;
    vector<int> Co_ma;
    int Count,Count_;

    rep(i,N) {
        
        cin >> S_[i];
    }

    sort(S_.begin(), S_.end());
    Co_str.push_back(S_[0]);
    Co.push_back(1);
    Co_ma.push_back(1);
    for(int i = 1; i < N; i++) {
        if(S_[i]==S_[i-1]){
            Co[Test]++;
            Co_ma[Test]++;
        }
        else {
            Co.push_back(1);
            Co_ma.push_back(1);
            Co_str.push_back(S_[i]);
            Test++;
        }

    }
    sort(Co_ma.begin(), Co_ma.end());
    int ma_=Co_ma[Test];
    rep(i,Test+1){
        if(Co[i]==ma_) cout << Co_str[i] << endl;

    }

    return 0;

}

Measured memory_bytes: 17504
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int w = stdIn.nextInt();
		int n = stdIn.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		for(int i = 0; i < n; i++) {
			String tmp = stdIn.next();
			String[] tmp2 = tmp.split(",");
			a[i] = Integer.parseInt(tmp2[0]);
			b[i] = Integer.parseInt(tmp2[1]);
		}
		int[] loc = new int[w];
		for(int i = 0; i < w; i++) {
			int p = i+1;
			for(int j = 0; j < n; j++) {
				if(a[j] == p) {
					p = b[j];
				}
				else if(b[j] == p) {
					p = a[j];
				}
			}
			loc[p-1] = i+1;
		}
		
		for(int i = 0; i < w; i++) {
			System.out.println(loc[i]);
		}
	}
}

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

#define ll long long 

int main() {
    ios::sync_with_stdio(0); 

    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (auto& x : a) cin >> x;
    sort(a.rbegin(), a.rend());
    int total = accumulate(a.begin(), a.end(), 0);
    for (int i = 0; i < m; i++) {
        if ( 4 * m * a[i] < total) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0; 
}



Measured memory_bytes: 3648
#include<iostream>
#include<set>
#include<cstring>
#include<algorithm>

using namespace std;

int CardDataA[100], CardDataB[100];
int DpResult[100][100];
const int INF = 50000000;

void Init() {
	memset(CardDataA, 0, sizeof(CardDataA));
	memset(CardDataB, 0, sizeof(CardDataB));

	for (int i = 0; i < 100; i++) {
		for (int j = 0; j < 100; j++) {
			DpResult[i][j] = INF;
		}
	}

	for (int i = 0; i < 100; i++) {
		DpResult[i][i] = 0;
	}
}

void solve(int n) {
	int current;

	for (int k = 1; k < n; k++) {
		for (int i = 0; i+k < n; i++) {
			for (int j = i; j < i + k; j++) {
				current = CardDataA[i] * CardDataB[j] * CardDataA[j + 1] * CardDataB[i + k];
				DpResult[i][i+k] = min(DpResult[i][i+k], DpResult[i][j] + DpResult[j+1][i+k] + current);
				//cout << "current:"<<current << "  Dp["<<i<<"]"<< "[" << i+k << "]=" << DpResult[i][i+k]<< endl;
			}
		}
	}
		
}

int main() {
	int n;

	Init();

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> CardDataA[i] >> CardDataB[i];
	}
	/*n = 0;
	while (CardDataA[n] != 0) {
		cout << CardDataA[n] << "  " << CardDataB[n] << endl;
		n++;
	}*/
	solve(n);
	cout << DpResult[0][n-1] << endl;

	return 0;
}




Measured memory_bytes: 3136
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;

int main(void){
    int n; cin >> n;
    vector<vector<int>> abc(n, vector<int>(3));
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            cin >> abc[i][j];
        }
        
    }

    vector<vector<int>> dp(n+1, vector<int>(3));
    dp[0][0] = dp[0][1] = dp[0][2] = 0;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            dp[i][j] = abc[i-1][j] + max(dp[i-1][(j+1)%3], dp[i-1][(j+2)%3]);
        }
    }
    cout << max(dp[n][0], max(dp[n][1], dp[n][2])) << endl;
}

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


int cmp(const void *a,const void *b){
    if(*(int*)a>*(int*)b){return 1;}
    else if(*(int*)a<*(int*)b){return -1;}
    else {return 0;}
}




int main(void){
    int n;
    int a[10005];
    int sum=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    for(int i=0;i<n;i++){
        for(;;){
            if(a[i]%2==0){a[i]=a[i]/2;sum++;}
            else{break;}
        }
    }
    printf("%d\n",sum);
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := newIo()
	defer io.Flush()
	N := io.NextInt()
	A := make([]int, N)

	result := "second"
	for i := range A {
		A[i] = io.NextInt()
		if A[i]%2 != 0 {
			result = "first"
		}
	}
	fmt.Println(result)
}

type io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func newIo() *io {
	return &io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *io) PrintLn(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *io) PrintIntLn(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func (io *io) PrintStringLn(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.PrintLn(b...)
}

func log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}


Measured memory_bytes: 4736
S = input()

T = input()

flag = 0


def judge(n):
    i = 0
    while S[i] == T[(i+n) % len(S)] :
#        print(S[i],T[(i+n) % len(S)])
        i += 1
        if i == len(S):
            print("Yes")
            return 1
            break
    return 0

for i in range(len(S)):
    j = judge(i)
    if j == 1:
        break

if j == 0:
    print("No")


Measured memory_bytes: 3060
N = gets.strip.to_i
A = gets.split.map(&:strip).map(&:to_i)

m = 10**9+7
x = 0
s = 0
(1..(N-1)).each do |i|
  x += A[i-1]
  y = A[i]
  s = (s + x * y) % m
end

puts s


Measured memory_bytes: 48060
def gcd(a,b):
    if b== 0:
        return a
    else:
        return gcd(b,a%b)

t = int(input())
abcd = []
ans = "No"
for i in range(0,t):
    ABCD = list(map(int,input().split()))
    abcd.append(ABCD)
for a,b,c,d in abcd:
    if a >= b and b==d and b <= c:
        ans = "Yes"
    if a >= b and d >= b and b > c and b - gcd(d,b) + a%gcd(d,b) <= c:
        ans = "Yes"
    if a >= b and d >= b and b <= c:
        ans = "Yes"
    print(ans)
    ans = "No"


Measured memory_bytes: 3188
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

char a[104];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    scanf("%s", a);
    int l = strlen(a);
    memset(a, 'x', l);
    printf("%s\n", a);

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

int main(void) {
    int n;

    std::cin >> n;

    switch(n%10) {
        case(3):
            std::cout << "bon" << std::endl;
            break;
        case(0):
        case(1):
        case(6):
        case(8):
            std::cout << "pon" << std::endl;
            break;
        default:
            std::cout << "hon" << std::endl;
    }
    return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
  int x,y,z,k;
  cin>>x>>y>>z>>k;
  vector<long long>a(x);
  vector<long long>b(y);
  vector<long long>c(z);
  vector<long long>d(0);
  vector<long long>e(0);
    for(int i=0;i<x;i++)cin>>a[i];
    for(int i=0;i<y;i++)cin>>b[i];
    for(int i=0;i<z;i++)cin>>c[i];
    sort(a.rbegin(),a.rend());
    sort(b.rbegin(),b.rend());
    sort(c.rbegin(),c.rend());
    for(int i=0;i<x;i++){
        for(int j=0;j<y;j++){
            d.push_back(a[i]+b[j]);
        }
    }
  sort(d.rbegin(),d.rend());
    for(int i=0;i<min(x*y,k);i++){
        for(int j=0;j<z;j++){
            e.push_back(d[i]+c[j]);
        }
    }
    sort(e.rbegin(),e.rend());
    for(int i=0;i<k;i++){
        cout<<e[i]<<endl;
    }
}

Measured memory_bytes: 43368
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define for1(i,n) for (ll i=0;i<(n);i++)
#define for2(i,m,n) for (ll i=(m);i<(n);i++)
#define for3(i,m,n,d) for (ll i=(m);i<(n);i+=(d))
#define DEBUG 0

ll solve()
{
    ll N, M;
    cin >> N >> M;
    return (N - 1) * (M - 1);
}

int main()
{
    do {
        cout << solve() << endl;
    } while (DEBUG);
}


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

#define _REP(i,a,b) for(int i = (a) ; i >= (int)(b) ; --i )
#define REP(i,a,b) for(int i = (a) ; i <= (int)(b) ; ++i )
#define UREP(i,u) for(int i = p[(u)] ; i + 1 ; i = edge[i].next)
//iterator: for(int u:x),x is container
#define x(p) (p).first
#define y(p) (p).second
#define pii pair<int,int>
#define mp(x,y) make_pair((x), (y))
#define ll long long
#define inf 0x3f3f3f3f
#define mem(x,v) memset((x), (v), sizeof (x))
#define ri1(x) scanf("%d", &(x))
#define ri2(x,y) scanf("%d%d", &(x), &(y))
#define ri3(x,y,z) scanf("%d%d%d", &(x), &(y), &(z))
#define ri4(a,b,c,d) scanf("%d%d%d%d", &(a), &(b), &(c), &(d))
#define pi1(a) printf("%d\n", (a))
#define pi2(a,b) printf("%d%d\n", (a), (b))

#ifdef kinesis
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

char S[10];

int main()
{
    scanf("%s",S+1);
    if(S[3]==S[4]&&S[5]==S[6]) puts("Yes");
    else puts("No");
    return 0;
}


Measured memory_bytes: 256
n=int(input())
S=[list(input())for i in range(n)]
A_cnt=0
B_cnt=0
AB_cnt=0
for s in S:
        if s[0]=="B" and s[-1]=="A":
                AB_cnt+=1
        elif s[-1]=="A":
                A_cnt+=1
        elif s[0]=="B":
                B_cnt+=1

cnt=0
for i in range(n):
        S[i].append("T")
        for j in range(len(S[i])):
                if S[i][j]=="A" and S[i][j+1]=="B":
                        cnt+=1
if A_cnt==B_cnt==0 and 0<AB_cnt:
        print(AB_cnt-1+cnt)
else:
        print(cnt+min(A_cnt+AB_cnt,B_cnt+AB_cnt))


Measured memory_bytes: 4596
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define mt make_tuple
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define vecpll vector<pll>
#define vecbl vector<bool>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
string stin(){string s;cin>>s;return s;}

int main(){
    int n=in();
    vecll a(n);
    rep(i,n)a[i]=in();
    sort(ALL(a));
    ll ans=0;
    if(n%2==0){
        for(int i=n/2;i<n;i++){
            ans+=a[i]*2;
        }
        ans-=a[n-1];
    }else{
        for(int i=n/2;i<n;i++){
            ans+=a[i]*2;
        }
        ans-=a[n-1];
        ans-=a[n/2];
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 4864
#include<bits/stdc++.h>
using namespace std;
int main(){


// #ifndef ONLINE_JUDGE   
// freopen("input.txt", "r", stdin); 
// // freopen("output.txt", "w", stdout);    
// #endif 
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);


long long int d,t,s;
cin>>d>>t>>s;

s=s*t;
if(s>=d) cout<<"Yes\n";
else cout<<"No\n";

}





Measured memory_bytes: 3644
from collections import Counter
n = int(input())
vn = list(map(int, input().split()))
odd = []
even = []
for i in range(n):
    if i % 2 == 0:
        even.append(vn[i])
    else:
        odd.append(vn[i])
ans = len(even) + len(odd)
count_odd = Counter(odd).most_common()
count_even = Counter(even).most_common()
if count_odd[0][0] == count_even[0][0]:
    if len(set(even)) != 1 and len(set(odd)) != 1:
        even2 = count_even[1][1]
        odd2 = count_odd[1][1]
        ans -= max(even2 + count_odd[0][1], odd2 + count_even[0][1])
    elif len(set(even)) != 1 and len(set(odd)) == 1:
        ans -= count_odd[0][1] + count_even[1][1]
    elif len(set(even)) == 1 and len(set(odd)) != 1:
        ans -= count_even[0][1] + count_odd[1][1]
    else:
        ans -= max(count_even[0][1], count_odd[0][1])
else:
    ans -= count_odd[0][1] + count_even[0][1]
print(ans)


Measured memory_bytes: 21076
from collections import defaultdict
N = int(input())
li = []
d = defaultdict(int)
for i in range(N):
  s = input()
  d[s] += 1
e = max(d, key=d.get)
li.append(e)
n = d.pop(e)
tmp = [k for k, v in d.items() if v == n]
li += tmp
li.sort()
print('\n'.join(li))

Measured memory_bytes: 35932
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF (2e9)
#define EPS (1e-7)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
    int a,b,t;
    cin>>a>>b>>t;
    int c = t / a;
    int ans = c * b;
    cout << ans << endl;
}

Measured memory_bytes: 256
import { readFileSync } from 'fs'

function main(input: string) {
  const [head, S] = input.split('\n')
  const [N, K] = head.split(' ').map(Number)

  const result = Array.from(S)
    .map((s, i) => i + 1 === K ? s.toLocaleLowerCase() : s)
    .join('')

  console.log(result)
}

main(readFileSync('/dev/stdin', 'utf8').trim())


Measured memory_bytes: 7500
import sys
sys.setrecursionlimit(100000)
N = int(input())
edges = [[] for i in range(N)]
e_list = []

for i in range(N-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    e_list.append((a,b))
    edges[a].append((b,i))
    edges[b].append((a,i))

ans = [0] * (N-1)

def dfs(v, p=-1, c=-1): #親p(はじめはいないので-1), 子がv, 親の色も渡す必要あり
    # 子が次の子孫をグラフから探す
    global ans
    next_v = edges[v]
    cnt = 1 # num of colors
    for u,i in next_v:
        # 子孫の中には親もいて、それは除外
        if u == p: continue
        # 子供に対しては自分が親となり、同様のことをする
        if cnt == c:
            cnt += 1
        ans[i] = cnt      
        cnt += 1
        dfs(u, v, ans[i])


dfs(0)
print(max(ans))
for a in ans:
    print(a)

Measured memory_bytes: 93968
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Yes() std::cout << "Yes" << std::endl
#define No() std::cout << "No" << std::endl
#define Say(s) std::cout << s << std::endl
const ll MOD = 1000000007;
const ll INF = 1061109567;

int main()
{
    std::string n;
    std::cin >> n;
    std::vector<char> c;
    for (auto v : n) {
        c.push_back(v);
    }
    if (c.at(c.size() - 1) == 's') {
        n += "es";
    } else {
        n += 's';
    }
    Say(n);
    return 0;
}

Measured memory_bytes: 3620
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 1e18
#define MOD 100000007
#define SIZE 10005
#define PI 	3.14159265358979323846

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,x;
    cin >> n >> x;
    ll ans=0;
    REP(i,n){
        //cout <<" " << ans << endl;
        ll a;
        cin >> a;
        a = abs(a-x);
        if(i==0){ ans = a; continue; }
        if(a<ans)swap(a,ans);
        ll r = a % ans;
        while(r!=0){
            a = ans;
            ans = r;
            r = a % ans;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
h,w = gets.chomp.split(' ').map(&:to_i)

s = []

h.times do
  s.push(gets.chomp.split(''))
end

s.each do |j|
  j.unshift('#')
  j.push('#')
end

s.unshift(Array.new(w+2,'#'))
s.push(Array.new(w+2,'#'))

s.each do |j|
  puts j.join()
end

Measured memory_bytes: 2300
#include <bits/stdc++.h>
#define int long long 
using namespace std;
typedef pair<int,int> ii;

int fact[1000005];
int mod = 1000000007;
long long qexp(long long b, long long p){
    long long res = 1;
    while(p){
        if(p&1) res = (res * b) % mod;
        b = (b * b) % mod;
        p >>= 1;
    }
    return res;
}
int inv(long long b){ return qexp(b, mod-2); }

signed main(){
	//freopen("i.txt","r",stdin);
	ios_base::sync_with_stdio(false); cin.tie(0);
	
	string s; cin >> s;
	for(int i = 0;i < s.length();i++){
		if(s[i] == '?') s[i] = 'D';
	}
	cout << s;
}


Measured memory_bytes: 3772
#include <stdio.h>
#define N 200000
typedef struct process{
	char name[11];
	int time;
}process;

process P[N];
int head = 0;
int bottom = 0;

void push(process x){
	P[head%N]= x;
	head++;
}
process pop(void){
	int d;
	d = bottom%N;
	bottom++;
	return P[d];
}

int main(int argc, char argv[]){
	int n;
	int q;
	int t=0;
	scanf("%d %d",&n,&q);
	process ins;

	int i;
	for(i=0;i<n;i++){
		scanf("%s %d",ins.name,&ins.time);
		push(ins);
	}

	while(head!=bottom){
		ins = pop();
		if(ins.time-q>0){
			ins.time -= q;
			push(ins);
			t += q;
		}else{
			t += ins.time;
			printf("%s %d\n",ins.name,t);
		}
	}

	return 0;
}

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

int main() {
 long int x;
 long int money = 100;
 long int year = 0;
  
    cin >> x;
    while(money < x)
    {
        money = money * 1.01;
        year ++;
    }
    cout << year << endl;
}

Measured memory_bytes: 3636
/*
    When you are not practicing someone else is,
    and the day u meet them u will Lose.

    So, all you need is Practice, Practice and Practice.
*/
#include <bits/stdc++.h>
using namespace std;
                     
#define int             long long
#define ld              long double
#define mp              make_pair
#define ff              first
#define ss              second
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(i=1;i<=n;i++)
#define FO(i,a,b)       for(i=a;i<=b;i++)
#define FOR(i,a,b)      for(i=a;i>=b;i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define vpii            vector<pii>
#define vvi             vector<vi>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x)           cout<<setprecision(x)<<fixed;
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define sz(v)           (int)v.size()
#define gcd             __gcd
#define lcm(x,y)        x*(y/gcd(x,y))
#define endl            '\n'
#define PI              3.14159265358979323846
const int inf =         1e18;
const int mod =         1e9+7;
void __p(int x) {cout<<x;}
void __p(int32_t x){cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
void _p() {cout << "]\n";}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
int po(int x,int p) {int ans=1;x%=mod;while(p>0){if(p&1)ans=(ans*x)%mod;p=p>>1;x=(x*x)%mod;}return ans;}
int inv(int x){return po(x,mod-2)%mod;}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
#else 
#define dbg(x...)
#endif
/**********************************************************************************/



const int N=1e6+6;
int n,m,k,x,y,z,a,b,c,d,i,j,l,r,f,q;








void sol()
{   
    cin>>n>>x>>y;
    
    
    
    
    cout<<  ((n<=x*y)?"Yes":"No")<<endl;
}





int32_t main()
{   
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //pre();
    //sp(10);
    // w(t)
    sol();
    return 0;
}


Measured memory_bytes: 3668
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        for(int i = 1; i <= 100000; i++){
            if((int)(i * 0.08) == a && (int)(i * 0.1) == b){
                System.out.println(i);
                return;
            }
        }
        System.out.println(-1);
        scan.close();
    }
}


Measured memory_bytes: 27060
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long inf=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;
#define FORR(x,arr) for(auto& x:arr)
#define ZERO(a) memset(a,0,sizeof(a))





//3111111111111111111111111111111

	void solve(){


		ini(a);
		ini(b);
		out(a*b);
			







	}	























int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall 
	oneforall

	solve();
	


	return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<vector<ll> > mat;

void solve()
{

}

int main()
{ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin>>n;
int a[105];
rep(i,0,n-1)cin>>a[i];
int ans=0;
sort(a,a+n);
rep(i,0,n-1)
{
	rep(j,i+1,n-1)
	{
		rep(k,j+1,n-1)
		{
			if(a[i]==a[j]||a[j]==a[k]||a[i]==a[k])continue;
			if(a[i]+a[j]>a[k])ans++;
		}
	}
}
ol(ans);
return 0;
}



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

int main(){
    int n, w;
    cin >> n >> w;
    int W[110], V[110];
    rep(i,n) cin >> W[i] >> V[i];

    long long dp[110][100010];
    rep(i,n){
        rep(j,100010){
            dp[i+1][j] = dp[i][j];
            if (j >= W[i]) dp[i+1][j] = max(dp[i][j-W[i]]+V[i], dp[i+1][j]);
        }
    }

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

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

int main() {
  int n, k;
  cin >> n >> k;
  int l = n / k;
  ll ans = (ll)l * l * l;
  if (k % 2 == 0) {
    int m = (n + k / 2) / k;
    ans += (ll)m * m * m;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3628
use proconio::{fastout, input};
use proconio::marker::*;
use std::collections::BinaryHeap;

#[fastout]
fn main() {
   input! {
      n: usize,
      m: usize,
      ab: [(Usize1, Usize1); m]
   }

   let mut to = vec![vec![]; n];
   for (a, b) in ab {
      to[a].push(b);
      to[b].push(a);
   }

   let mut q = BinaryHeap::new();
   let mut d = vec![1000005; n];
   q.push((0i64, 0));
   d[0] = 0;
   while let Some((c, v)) = q.pop() {
      let c = -c;
      if d[v] != c {
         continue;
      }
      for &u in to[v].iter() {
         if c + 1 < d[u] {
            d[u] = c + 1;
            q.push((-(c+1), u));
         }
      }
   }
   for i in 0..n {
      if d[i] == 1000005 {
         println!("No");
         return;
      }
   }
   println!("Yes");
   for v in 1..n {
      for &u in to[v].iter() {
         if d[v] == d[u] + 1 {
            println!("{}", u + 1);
            break;
         }
      }
   }
}


Measured memory_bytes: 15948
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  IOS;
  int n; cin >> n;
  int h[n]; REP(i,n) cin >> h[i];

  int cnt=0,ans=0;
  for (int i = 1; i < n; i++) {
    if (h[i] <= h[i-1]) cnt++;
    else { chmax(ans,cnt); cnt=0; }
  }
  chmax(ans,cnt);
  COUT(ans);
  return 0;
}

Measured memory_bytes: 640
#if 0

#endif

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef complex<double> xy_t;

double dot_product(xy_t a, xy_t b) {
  return (conj(a)*b).real();
}
double cross_product(xy_t a, xy_t b) {
  return (conj(a)*b).imag();
}
xy_t projection(xy_t p, xy_t b) {
  return b*dot_product(p,b)/norm(b);
}

xy_t P[110];
int N;
int main() {
  cin >> N;
  int x, y;
  for (int i = 0; i < N; i++) {
    cin >> x >> y;
    P[i] = xy_t(x*1.0,y*1.0);
  }
  double sum = 0.0;
  for (int i = 0; i + 2 < N; ++i) {
    xy_t a = P[0], b = P[i+1], c = P[i+2];

    sum += cross_product(b-a, c-a)/2.0;
  }
  printf("%.1f\n", abs(sum));
}



Measured memory_bytes: 3212
#include<iostream>
#include<list>
#include<cmath>
#include<vector>
#include<map>
using namespace std;
#define chmin(a,b) (a>(b)?a=(b),1:0)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
typedef long int li;

void exchange(int& a, int& b,int flag){
  if(flag) swap(a,b);
  a/=2; b+=a;
  if(flag)swap(a,b);
}

int main(){
  int a,b,k; cin >>a >>b >>k;
  rep(i,k){
    exchange(a,b,i%2);
  }
  cout << a << " " << b << "\n";
}


Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> v;
string s;
ll n,cnt,a,b,ans;
char L;
int main(void){
    cin>>s;
    n=s.size();
    L=s[0];
    if(L=='>')v.push_back(1);
    cnt=1;
    for(int i=1;i<n;i++){
        if(L!=s[i]){
            if(L=='<')v.push_back(cnt);
            else v.push_back(-cnt);
            cnt=1;
            L=s[i];
        }
        else cnt++;
    }
    if(L=='<')v.push_back(cnt);
    else v.push_back(-cnt);
    //for(auto x:v)cout<<x<<endl;
    if(v[v.size()-1]>0)v.push_back(-1);
    for(int i=0;i<v.size();i+=2){
        v[i+1]=abs(v[i+1]);
        a=max(v[i],v[i+1]);
        b=min(v[i],v[i+1]);
        ans+=a*(a+1)/2;
        ans+=b*(b-1)/2;
    }
    cout<<ans<<endl;
}


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

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

using namespace std;
typedef long long int ll;
const int INF = 1000000000;
const double PI = acos(-1);
const int mod = 1000000007;

int dp[100001] = {0};

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> h(n+1, 0);
    for(int i = 1; i<=n; i++) cin >> h[i];

    for (int i = 2; i <= n; i++) {
        int c = INF;
        for (int j = 1; j <= k; j++) {
            if (i - j >= 1) {
                c = min(c, dp[i - j] + abs(h[i] - h[i - j]));
            }
        }
        dp[i] = c;
    }
    cout << dp[n] << endl;
    return 0;
}


Measured memory_bytes: 3992