akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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; }

typedef long long ll;
typedef pair<ll, ll> p;

long double logn(ll base, ll tv)
{
  return log(tv) / log(base);
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll x;
  cin >> x;
  ll money = 100;
  for (int i = 1; ; ++i) {
    money = double(money)*1.01;

    if(money >= x) {
      cout << i << endl;
      break;
    }
  }


}


Measured memory_bytes: 3696
#include <iostream>                                             
#include <cstring>                                              
using namespace std;                                            
                                                                
int main(void) {                                                
  int house[4][3][10];                                          
  memset(house,0,sizeof(house));                                
  int n;                                                        
  cin >> n;                                                     
  int b, f, r, v;                                               
  while (n--) {                                                 
    cin >> b >> f >> r >> v;                                    
    house[b-1][f-1][r-1] += v;                                  
  }                                                             
  for (int i=0; i<4; i++) {                                     
    for (int j=0; j<3; j++) {                                   
      for (int k=0; k<10; k++) {                                
        cout << " " << house[i][j][k] << flush;                 
      }                                                         
      cout << endl;                                             
    }                                                           
    if (i==3) {                                                 
      break;                                                    
    }                                                           
    for (int i=0; i<20; i++) {                                  
      cout << "#" << flush;                                     
    }                                                           
    cout << endl;                                               
  }                                                             
  return 0;                                                     
}                                                               
                                                                
                                                                
                                 

Measured memory_bytes: 3080
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		try {
			System.setIn(new FileInputStream("src/xxxyyyy/input.txt"));
			System.setOut(new PrintStream(new FileOutputStream("src/xxxyyyy/result.txt")));
		} catch (FileNotFoundException e) {
		}
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int T = sc.nextInt();
		for(int tno = 0; tno < T; tno++) {
			int R = 8, C = 8;
			char[][] table = new char[8][];
			for(int i = 0; i < 8; i++)
				table[i] = sc.next().toCharArray();
			int c = sc.nextInt() - 1;
			int r = sc.nextInt() - 1;
			
			Queue<Integer> q = new LinkedList<Integer>();
			q.add(r); q.add(c);
			while(!q.isEmpty()) {
				r = q.poll();
				c = q.poll();
				
				for(int dr = -3; dr <= 3; dr++)
					if ( 0 <= r + dr && r + dr < 8 && table[r + dr][c] == '1') {
						q.add(r + dr); q.add(c);
						table[r + dr][c] = '0';
					}
				for(int dc = -3; dc <= 3; dc++)
					if ( 0 <= c + dc && c + dc < 8 && table[r][c + dc] == '1') {
						q.add(r); q.add(c + dc);
						table[r][c + dc] = '0';
					}
			}
			System.out.println("Data " + (tno + 1) + ":");
			for(int i = 0; i < 8; i++) {
				for(int j = 0; j < 8; j++) System.out.print(table[i][j]);
				System.out.println();
			}
			
			
		}
		while(sc.hasNext()){
			String s = sc.next();
			for(int i = 0; i < s.length(); i++){
				if ( s.charAt(i) == '@') {
					i++;
					int n = s.charAt(i) - '0';
					i++;
					while(n-->0) System.out.print(s.charAt(i));
				} else
					System.out.print(s.charAt(i));
			}
			System.out.println();
		}
	}

}

Measured memory_bytes: 12000
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int thp = sc.nextInt();
        int tk = sc.nextInt();
		int ahp = sc.nextInt();
        int ak = sc.nextInt();
      
            String result = "";
      
      for(int i=0; i<100; i++){
        ahp = ahp - tk;
        
       if(ahp <= 0){
        result = "Yes";
        break;
       }
              
      	thp = thp - ak;
      
      if(thp <= 0){
        result = "No";
        break;
      }
      
      }
		// 文字列の入力
		System.out.println(result);
	}
}

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

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver2 {
 public:
  int A, B, m;
  vector<LL> a, b;
  Solver2(LL A, LL B, LL m) : A(A), B(B), m(m), a(A), b(B){};

  void solve() {
    for (int i = 0; i < A; ++i) {
      cin >> a[i];
    }
    for (int i = 0; i < B; ++i) {
      cin >> b[i];
    }
    LL ans = *min_element(a.begin(), a.end()) + *min_element(b.begin(), b.end());
    for (int i = 0; i < m; ++i) {
      LL x, y, z;
      cin >> x >> y >> z;
      ans = min(ans, a[--x] + b[--y] - z);
    }
    cout << ans << endl;
  }
};
}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(12);
  long long a, b, m;
  std::cin >> a >> b >> m;

  Problem::Solver2 sol(a, b, m);
  sol.solve();
  return 0;
}


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

namespace ConsoleApp15
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
            if(int.Parse( str[0]) >= 10)
            {
                Console.WriteLine(int.Parse(str[1]));
            }
            else
            {
                Console.WriteLine(int.Parse(str[1]) + 100 * (10 -int.Parse( str[0])) );
            }
        }
    }
}


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

static const int INFTY = (1<<29);

int main(){
    int n,m,sum=0;
    char russia[55][55];
    cin >> n >> m;
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            cin >> russia[i][j];
            if(i==0 && russia[i][j]!='W'){
                sum++;
            }
            if(i==n-1 && russia[i][j]!='R'){
                sum++;
            }
        }
    }
    int C[55];
    for(int i=0; i<n; i++){
        C[i] = 0;
    }
    int tuika[n][n];
    for(int i=0; i<n-2; i++){
        for(int j=0; j<n-2; j++){
            tuika[i][j]=0;
        }
    }
    //int d,v,l;
    for(int i=1; i<=n-2; i++){
        for(int y=i; y<=n-2; y++){
        for(int a=1; a<i; a++){
            for(int j=0; j<m; j++){
                if(russia[a][j]!='W'){
                    tuika[i-1][y-1]++;
                }
            }
        }
        for(int u=i; u<=y; u++){
        for(int j=0; j<m; j++){
            if(russia[u][j]!='B'){
                tuika[i-1][y-1]++;
            }
        }
        }
        for(int j=y+1; j<n-1; j++){
            for(int r=0; r<m; r++){
                if(russia[j][r]!='R'){
                    tuika[i-1][y-1]++;
                }
            }
        }
    }
    }
    int min=INFTY;
    for(int i=0; i<n-2; i++){
        for(int j=i; j<n-2; j++){
            if(min>tuika[i][j]){
                min = tuika[i][j];
            }
            //cout << "   " << "SUM = " << tuika[i][j] << endl;

        }
    }
    /*cout << "  " << min << endl;
    cout << "  " << sum << endl;*/
    cout << min+sum << endl;
}

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

int powmod(int a, int n, int mod) {
	if (n == 0) return 1;
	if (n % 2 == 0) return powmod((a * a) % mod, n / 2, mod);
	return (a * powmod(a, n - 1, mod)) % mod;
}

int mod = 998244353;
int n, m, k;
int fact[200001];
int finv[200001];

int comb(int n, int k) {
	return fact[n] * finv[k] % mod * finv[n - k] % mod;
}

signed main() {
	int i;
	
	fact[0] = 1;
	finv[0] = 1;
	for (i = 1; i <= 200000; i++) {
		fact[i] = (i * fact[i - 1]) % mod;
		finv[i] = powmod(fact[i], mod - 2, mod);
	}
	
	cin >> n >> m >> k;
	
	int ans = 0;
	for (i = 0; i <= k; i++) {
		int x = n - i;
		int res = comb(n - 1, x - 1) * m % mod * powmod(m - 1, x - 1, mod) % mod;
		ans += res;
		ans %= mod;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 6764
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {

		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str;
		while((str=br.readLine())!=null){
			String[] sp = str.split(" ");

			int D = Integer.parseInt(sp[0]);
			int L = Integer.parseInt(sp[1]);

			if(D % L == 0){
				System.out.println(D / L);
			} else{
				System.out.println(D / L + D % L);
			}
		}
	}
}

Measured memory_bytes: 24432
#include<bits/stdc++.h>
using namespace std;
 
#define int long long
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
 
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
 
int N;
int A[111111];
 
int cnt[111111];
 
signed main(){
    cin>>N;
    rep(i,N)cin>>A[i];
 
    rep(i,N)cnt[A[i]]++;
 
    int ans=0;
    int d=0;
    rep(i,111111){
        if(!cnt[i])continue;
        ans++;
        d+=cnt[i]-1;
    }
 
    if(d&1)ans--;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back

int main(){
    vector<vector<char>> ten_key(10);
    ten_key[0] = {'\n'};
    ten_key[1] = {' ', '.', ',', '!','?'};
    ten_key[2] = {'c', 'a', 'b'};
    ten_key[3] = {'f', 'd', 'e'};
    ten_key[4] = {'i', 'g', 'h'};
    ten_key[5] = {'l', 'j', 'k'};
    ten_key[6] = {'o', 'm', 'n'};
    ten_key[7] = {'s', 'p', 'q', 'r'};
    ten_key[8] = {'v', 't', 'u'};
    ten_key[9] = {'z', 'w', 'x', 'y'};

    int N; cin >> N;
    while(N--){
        string S; cin >> S;
        string ans = "";
        int num = 0, cnt = 0;
        for(auto& c : S){
            if(c == '0' && num != 0){
                ans += ten_key[num][cnt];
                num = 0;
                cnt = 0;
            } else {
                num = int(c - '0');
                cnt = (cnt + 1) % ten_key[num].size();
            }
        }

        cout << ans << endl;
    }
}



Measured memory_bytes: 3164
import java.util.Scanner;
public class Main{
		public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int time[] = new int[3];
	        int x = sc.nextInt();


	        time[0]=x/3600;
	        x = x-time[0]*3600;
	        time[1]=x/60;
	        time[2]=x%60;
	        System.out.println(time[0]+":"+time[1]+":"+time[2]);
	        sc.close();
	}
}



Measured memory_bytes: 26260
#include <iostream>
#define inf 0x3f3f3f3f
using namespace std;

int init(int x){
    int  a=0;
    while(x){
        a += x%10;
        x/=10;
    }
    return a;
}

int main(){
    int n;
    cin>>n;
    int mi = inf;
    for(int i=1;i<=n/2;i++){
        int ans = init(i)+init(n-i);
        mi = min(mi,ans);
    }
    cout<<mi<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#define REP(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    cout << (N-1)/2 << endl;
    return 0;
}

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

using namespace std;

#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 ALL(a) (a).begin(),(a).end()
#define PI 3.141592653589793238
#define INF 1050000000

using vi = vector<int>;


int main() {

	int N;

	cin >> N;

	cout << (N%2==0?(N/2)*(N/2):(N/2)*(N/2+1)) << endl;


	return 0;
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    ll N;
    cin >> N;

    if(N <1000){
        cout << "ABC" << endl;
    }
    else{
        cout << "ABD" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    ll x;
    cin >> x;
    ll ans = 0;
    ans +=  (x / 11) * 2;
    ll tmp = x % 11;
    if(tmp > 0 && tmp <= 6) ans += 1;
    else if(tmp > 6) ans += 2;
    
    output(ans);
    
    
    return 0;
}

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

int main() {

	int K;
	cin >> K;
	vector<int> v(32);
	 v = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
};
	cout << v.at(K-1) << endl;

}


Measured memory_bytes: 256
package main

import(
	"fmt"
	"sort"
)

type restaurant struct{
	name string
	no,rate int
}

type restaurants []restaurant

func (a restaurants) Len()int{ return len(a) }
func (a restaurants) Less(i,j int)bool{
	if a[i].name==a[j].name{
		return a[i].rate > a[j].rate
	} else {
		return a[i].name<a[j].name
	}
}
func (a restaurants) Swap(i,j int){ a[i], a[j] = a[j], a[i] }

func main(){
	var n int
	fmt.Scanln(&n)
	r:=make(restaurants,n)
	for i:=0;i<n;i++{
		r[i].no=i
		fmt.Scanln(&r[i].name,&r[i].rate)
	}
	sort.Sort(r)
	for i:=0;i<n;i++{
		fmt.Println(r[i].no+1)
	}
}

Measured memory_bytes: 512
#include<stdio.h>
int main() {
  int n,i,j,tmp,count=0;
  int a[100];

  scanf("%d",&n);

  for(i = 0 ; i < n ; i++) {
    scanf("%d",&a[i]);
  }

  for(i = 0 ; i < n-1 ; i++) {
    for(j = n-1 ; j > i ; j--) {
      if(a[j-1] > a[j]) {
	tmp = a[j];
	a[j] = a[j-1];
	a[j-1] = tmp;
	count++;
      }
    }
  }

  for(i = 0 ; i < n-1 ; i++) {
    printf("%d ",a[i]);
  }
  printf("%d",a[i]);
  printf("\n");
  printf("%d\n",count);
  return 0;
}



Measured memory_bytes: 2136
#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include <cstdio>
#include <deque>
#include <algorithm>
#include <string>
#include <cstring>

using namespace std;
int a[101];
int go(int x, int y) {
	if (x == y)return a[x];
	if (x > y)return 0;
	int ans = 9999;
	for (int i = x; i <= y; i++) {
		ans = min(ans, a[i]);
	}
	vector<int> v;
	for (int i = x; i <= y; i++) {
		a[i] -= ans;
		if (a[i] == 0)v.push_back(i);
	}
	int s = x;
	for (int i = 0; i < v.size(); i++) {
		ans += go(s, v[i] - 1);
		s = v[i] + 1;
	}
	ans += go(s, y);
	return ans;
}
int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	cout << go(0, n - 1) << '\n';




}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <string>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using vl = vector<ll>;  // long longの1次元の型に vl という別名をつける
using vvl = vector<vl>; // long longの2次元の型に vvl という別名をつける
int MOD = 1000000007; //10^9 + 7

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

// 無限大の値
const ll  lINF = 1LL << 60;
const int iINF = 1 << 29;

int main(void){
  int x,a,b;
  cin >> x >> a >>b;

  int bb=(x-a)/b;
  cout << x-a-bb*b << endl;
  return 0;
} 

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

ll dp[101][100001];

ll nps(ll* v_arr, ll *w_arr, ll w, ll n){
	if(w == 0 || n == 0) return 0;
	if(dp[n][w]) return dp[n][w]; 
	ll ans = 0;
	if(w - v_arr[n - 1] >= 0) ans =  w_arr[n - 1] + nps(v_arr, w_arr, w - v_arr[n - 1], n - 1);

	ans = max(ans, nps(v_arr, w_arr, w, n - 1));
	dp[n][w] = ans;
	return ans;
}


int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	ll n , w;
	cin >> n >> w;
	memset(dp, 0, sizeof dp);
	ll v_arr[n], w_arr[n];
	for(int i = 0; i < n; i++){
		cin >> v_arr[i] >> w_arr[i];
	}
	cout << nps(v_arr, w_arr, w , n);
	
}


Measured memory_bytes: 82524
#include <iostream>
#include <cmath>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
using namespace std;
typedef long long ll;

int main(void) {
    ll n, m, ans;
    cin >> n >> m;
    
    if(n>=2 && m>=2)
        ans = (n-2)*(m-2);
    else if(n==1 && m>=2)
        ans = m-2;
    else if(n>=2 && m==1)
        ans = n-2;
    else
        ans = 1;
    
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<map>
#include<numeric>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MAX 1000000000
using namespace std;
typedef long long ll;

int main(){
  string s, t; cin >> s >> t;
  int S = s.length(), T = t.length();

  string ans;
  rep(i, 0, S-T+1){
    bool ok = true;
    rep(j, 0, T){
      if(s[i+j]!=t[j] && s[i+j]!='?') ok = false;
    }
    if(ok){
      string tmp = s;
      rep(j, 0, T)  tmp[i+j] = t[j];
      rep(j, 0, S)  if(tmp[j]=='?') tmp[j] = 'a';
      if(ans.empty()) ans = tmp;
      else ans = min(ans, tmp);
    }
  }
  cout << (ans.empty()?"UNRESTORABLE":ans) << endl;
  return 0;
}

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

using namespace std;

int a[100];

int main() {
    int K, T; scanf("%d %d", &K, &T);
    int sum = 0;
    for(int i = 0; i<T; ++i) {
        scanf("%d", a+i);
        sum += a[i];
    }
    int ans = 0;
    for(int i = 0; i<T; ++i) {
        if( (sum-a[i]+1) < a[i] )
            ans += (2*a[i]-sum-1);
    }
    printf("%d\n", ans);
}


Measured memory_bytes: 256
#include <stdlib.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
const long long INF=1LL << 60;
long long a,b;
long long dp[100200][110];
long long w[110],v[110];





int main(){
   string s;
   cin>>s;
   rep(i,s.size()){
       cout<<"x";
   }
   cout<<endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define db double
#define pint pair<int,int>
#define mk(x,y) make_pair(x,y)
#define fir first
#define sec second
#define Rep(x,y,z) for(int x=y;x<=z;x++)
#define Red(x,y,z) for(int x=y;x>=z;x--)
using namespace std;
const int MAXN=105,Mod=1e9+7;
char buf[1<<12],*p1=buf,*p2=buf,nc;int ny;
inline char gc() {return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<12,stdin),p1==p2)?EOF:*p1++;}
//inline char gc(){return getchar();}
inline int read(){
	int x=0;for(ny=1;nc=gc(),(nc<48||nc>57)&&nc!=EOF;)if(nc==45)ny=-1;if(nc<0)return nc;
	for(x=nc-48;nc=gc(),47<nc&&nc<58&&nc!=EOF;x=(x<<3)+(x<<1)+(nc^48));return x*ny;
}inline int Fp(int x,int k){int ans=1;for(;k;k>>=1,x=1ll*x*x%Mod)if(k&1)ans=1ll*ans*x%Mod;return ans;}
int sz[MAXN],len[MAXN],f[MAXN],g[MAXN],num[MAXN],stk[MAXN],id[MAXN],n,ans=1;
vector<int>G[MAXN];
void dfs(int x){
	int ans=1,s=sz[x];f[x]=1,g[x]=0;
	for(int i=0,len=G[x].size(),y;i<len;i++){
		dfs(y=G[x][i]),g[x]=(1ll*g[x]*(f[y]+g[y])+1ll*f[x]*g[y])%Mod,f[x]=1ll*f[x]*f[y]%Mod,s-=sz[y];
	}g[x]=(1ll*g[x]*Fp(2,s)%Mod+1ll*f[x]*(Fp(2,s)-1))%Mod,f[x]=1ll*f[x]*Fp(2,len[x])%Mod;
}
inline int Solve(int l,int r){
	int cnt=0,top=0;stk[0]=l-1;
	Rep(i,l,r){
		while(top&&num[stk[top]]>=num[i])
			if(num[stk[top]]==num[i]){stk[top]=i;break;}
			else if(num[i]>num[stk[top-1]]){
				int v=++cnt;G[v].clear(),G[v].push_back(id[top]),len[id[top]]=num[stk[top]]-num[i];
				sz[id[top]]=i-stk[top-1]-2,stk[top]=i,id[top]=v;break;
			}else len[id[top]]=num[stk[top]]-num[stk[top-1]],sz[id[top]]=i-stk[top-1]-2,G[id[top-1]].push_back(id[top]),top--;
		if(stk[top]!=i){int v=++cnt;stk[++top]=i,id[top]=v,G[v].clear();}
	}while(top){
		len[id[top]]=num[stk[top]]-num[stk[top-1]],sz[id[top]]=r-stk[top-1]-1;
		if(top>1)G[id[top-1]].push_back(id[top]);top--;
	}dfs(id[1]);return (f[id[1]]+g[id[1]])%Mod;
}
int main(){
	n=read();
	Rep(i,1,n)num[i]=read()-1;
	Rep(i,1,n){
		if(!num[i]||!num[i-1])ans=ans*2%Mod;
		if(num[i]&&!num[i+1]){
			int l=i;for(;num[l-1];l--);
			ans=1ll*ans*Solve(l,i)%Mod;
		}
	}cout<<ans<<'\n';
	return 0;
}




Measured memory_bytes: 3580
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <queue>
#define rep(i, a, b) for (int i = (a), _ = (b); i <= _; ++ i)
#define per(i, a, b) for (int i = (a), _ = (b); i >= _; -- i)
#define For(i, a, b) for (int i = (a), _ = (b); i < _; ++ i)
#define ri rd<int>
using namespace std;
const int maxN = 1e6 + 7;

template<class T> inline T rd() {
	bool f = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') f = 0;
	T x = 0; for (; isdigit(c); c = getchar()) x = x * 10 + c - 48; return f ? x : -x;
}

inline void NIE() { puts("-1"); exit(0); }

int n;
char s[maxN], t[maxN];
deque<int>q; int delta;

inline int eval(int x) { return x - delta; }

int main() {

	n = ri(); scanf("%s%s", s+1, t+1);

	int res = 0;
	for (int i = n, j = n; i > 0; -- i) {
		for (j = min(j, i); j && s[j] != t[i]; -- j);
		if (j == 0) NIE();
		if (j == i) continue;
		if (!q.empty() && j == eval(q.front())) continue;
		while (!q.empty() && eval(q.back()) > i) q.pop_back();
		res = max(res, 1+(int)q.size());
		++delta;
		q.push_front(j + delta);
	}
	printf("%d\n", res);

	return 0;
}


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

using namespace std;

const int N = 100005;

int n;

int main() {
	scanf("%d", &n);

	long long ans = 0;

	int mn = n;
	for(int i = 1; i <= n; i++) {
		int x;
		scanf("%d", &x);
		ans += x <= mn;
		mn = min(mn, x);
	}

	printf("%lld\n", ans);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
 
 
int main()
{
   int a,b,h,m;
   cin>>a>>b>>h>>m;
 
   double dist, angm, angh, angle;
 
   angm=6.0*m;
   angh=h*30.0+m/2.0;
 
   angle=abs(180.0-(angm-angh));
 
   angle=angle*3.141592653589793238/180.0;
 
   dist=sqrt(a*a + b*b + 2*a*b*cos(angle)) ;
 
   cout<<fixed<<setprecision(20)<<dist;
 
    return 0;
}

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

#define mem(t, v)   memset ((t) , v, sizeof(t))
#define all(x)      x.begin(),x.end()
#define un(x)       x.erase(unique(all(x)), x.end())
#define sf(n)       scanf("%d", &n)
#define sff(a,b)    scanf("%d %d", &a, &b)
#define sfff(a,b,c) scanf("%d %d %d", &a, &b, &c)
#define sl(n)       scanf("%lld", &n)
#define sll(a,b)    scanf("%lld %lld", &a, &b)
#define slll(a,b,c) scanf("%lld %lld %lld", &a, &b, &c)
#define D(x)        cerr << __LINE__ << ": " << #x << " = " << (x) << '\n'
#define DBG         cerr << __LINE__ << " Hi" << '\n'
#define pb          push_back
#define PI          acos(-1.00)
#define xx          first
#define yy          second
#define eps         1e-9

typedef unsigned long long int ULL;
typedef long long int LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;


inline int setBit(int N, int pos) { return N=N | (1<<pos); }
inline int resetBit(int N, int pos) { return N= N & ~(1<<pos); }
inline bool checkBit(int N, int pos) { return (bool)(N & (1<<pos)); }

//int fx[] = {+0, +0, +1, -1, -1, +1, -1, +1};
//int fy[] = {-1, +1, +0, +0, +1, +1, -1, -1}; //Four & Eight Direction

int n;
struct data{
    int num, cost;
};

bool operator < (data a, data b)
{
    return (a.cost > b.cost);
}

priority_queue<data>Q;

int dist[100010];
const int inf = 1e9;
int dijkstra()
{
    for(int i = 0; i<n; i++)
        dist[i] = inf;
    for(int i = 1; i<=min(9,n-1); i++)
    {
        dist[i%n] = i;
        Q.push({i%n, i});
    }
    while(!Q.empty())
    {
        data nw = Q.top();
        Q.pop();
//        D(nw.num);D(nw.cost);D(dist[nw.num]);
        for(int i = 0; i<=9; i++)
        {
            int tmp = (nw.num * 10);
            tmp += i;
            tmp %= n;
//            D(tmp);D(i);D(dist[tmp]);D(dist[nw.num]+i);
            if(dist[tmp] > dist[nw.num] + i)
            {
                dist[tmp] = dist[nw.num] + i;
//                if(tmp == 4)    DBG;
                Q.push({tmp, dist[tmp]});
            }
        }
//        exit(0);
    }
    return dist[0];
}

int main()
{
    //freopen("maxon.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    sf(n);
    printf("%d\n",dijkstra());
    return 0;
}



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

int main(){
  int N;
  long long sum=0;
  cin >> N;
  vector<long long> A(N);
  for(int i=0;i<N;i++){
    cin >> A[i];
    sum += A[i];
  }
  float half=sum/2;
  int index;
  long long ss=0;
  for(int i=0;i<N;i++){
    ss+=A[i];
    if(ss>=half){
      index = i;
      break;
    }
  }
    cout << min(2*ss-sum,sum-2*(ss-A[index])) << endl;
  
}




Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;
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; }
struct UnionFind {
    vector<int> par;
    
    //要素nで初期化
    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }
    
    //xが属する集合の根を返す
    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    //xとyが同じ集合に属しているかを判定
    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    //xが属する集合とyが属する集合をマージ
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // 計算量が減るよ
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    //xが属する集合のサイズ
    int size(int x) {
        return -par[root(x)];
    }
};

int main(){
	int n,m;cin>>n>>m;
	UnionFind uf(n);
	for(int i = 0; i < m; i++) {
		int a,b;cin>>a>>b;a--;b--;
		uf.merge(a,b);
	}
	set<int> res;
	for(int i = 0; i < n; i++) {
		int r = uf.root(i);
		res.insert(r);
	}
	cout << res.size() - 1 << endl;
	return 0;
}

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

using namespace std;
using ll =long long;

#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}

const ll INF = 1LL << 60;

ll n,m;
string s;
//Write From this Line

const int mod = 1e9+7;
int main()
{
	int a,b;
	cin >> a >>b ;
	for(int i = 1 ; i <= 3 ; i ++){
		if(i!=a&&i!=b){
			cout << i << endl;
			return 0;
		}
	}
}


Measured memory_bytes: 256
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("fma,avx,avx2")

#include <bits/stdc++.h>

using namespace std;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

#define int long long


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

    int k;
    cin >> k;
    for (int i = 0; i < k; i++) {
        cout << "ACL";
    }

    return 0;
}


Measured memory_bytes: 3620
#include <iostream> 
#include <string> 
#include <vector> 
#include <cmath> 
#include <algorithm> 
#include <cstdlib> 
#include <ctime> 
#include <cstdio> 
#include <functional> 
#include <set> 
#include <sstream> 
#include <cctype>

using namespace std; 

#define MP make_pair
typedef unsigned long long ULL;

long dp[50001];


int main(){

	long n;
	int m;
	cin>>n>>m;

	vector<int> d(m);
	for(int i=0;i<m;i++){
		cin>>d[i];
		dp[d[i]]=1;
	}

	for(long i=2;i<=n;i++){
		if(dp[i]==0) dp[i]=60000;
		for(int j=0;j<m;j++){
			if(i<d[j]) continue;
			if(dp[i-d[j]]!=0) dp[i]=min(dp[i],dp[i-d[j]]+1);
		}
	}

	cout<<dp[n]<<endl;

	return 0;
}

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

int f(int a){
  if(a%2==0){
    return a/2;
  }else{
    return 3*a+1;
  }
}

int main(){
  int s;
  cin >> s;
  map<int,int> mp;
  mp[s]++;
  int a[1000010];
  a[0]=s;
  for(int i=1;i<1000010;i++){
    a[i]=f(a[i-1]);
    mp[a[i]]++;
    if(mp[a[i]]==2){
      cout << i+1 << endl;
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    long long int n,a,b;
    scanf("%lld%lld%lld",&n,&a,&b);
    if(n%(a+b)<=a)
    printf("%lld",(n/(a+b)*a+n%(a+b)));
    else
    {printf("%lld",(n/(a+b)*a+a));}
    return 0;
}

Measured memory_bytes: 128
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	private static FastScanner sc = new FastScanner();
	private static char[] op = {'N', 'W', 'W', 'W', 'N'};

	public static void main(String[] args) {

		int[] num = new int[6];
		for(int i=0; i<num.length; i++){
			num[i] = sc.nextInt();
		}

		Dice dice = new Dice(num);

		int q = sc.nextInt();

		for(int i=1; i<=q; i++){
			int uside = sc.nextInt();
			int fside = sc.nextInt();

			for(int j=0; j<=op.length; j++){
				if(dice.getUpside() == uside){
					break;
				}

				dice.lotate(op[j]);
			}

			for(int j=1; j<=4; j++){
				if(dice.getFrontside() == fside){
					break;
				}

				dice.spin();
			}

			System.out.println(dice.getRightside());
		}

	}

	static class FastScanner
    {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

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

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

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

	static class Dice {

		//0:?????¢???1:S??´??¢???2:E??´??¢???3:W??´??¢???4:N??´??¢???5:?????¢
		int[] num;

		Dice(int[] num){
			this.num = num;
		}

		int getUpside(){
			return num[0];
		}

		int getFrontside(){
			return num[1];
		}

		int getRightside(){
			return num[2];
		}

		void lotate(char direction){
			int temp;
			switch(direction){
			case 'N':
				temp = num[0];
				num[0] = num[1];
				num[1] = num[5];
				num[5] = num[4];
				num[4] = temp;
				break;

			case 'S':
				temp = num[0];
				num[0] = num[4];
				num[4] = num[5];
				num[5] = num[1];
				num[1] = temp;
				break;

			case 'W':
				temp = num[0];
				num[0] = num[2];
				num[2] = num[5];
				num[5] = num[3];
				num[3] = temp;
				break;

			case 'E':
				temp = num[0];
				num[0] = num[3];
				num[3] = num[5];
				num[5] = num[2];
				num[2] = temp;
				break;
			}
		}

		//????¨????????????????
		void spin(){
			int temp = num[1];
			num[1] = num[2];
			num[2] = num[4];
			num[4] = num[3];
			num[3] = temp;
		}

	}

}

Measured memory_bytes: 24288
# ABC158a


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

    s = input()[:-1]
    if (len(set(s)) == 1):
        print('No')
    else:
        print('Yes')


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>

using namespace std;
int main(void){
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N;i++) cin >> A.at(i);
    int max=0;
    sort(A.begin(),A.end());


    for(int j=0;j<N;j++){
        if(max < abs(A[0]-A[j])) max=abs(A[0]-A[j]);
    }

    cout << max << endl;

    return 0;
}

Measured memory_bytes: 256
def partition(p, r):
    x = a[r]
    i = p-1

    for j in range(p, r):
        if a[j] <= x:
            i += 1
            a[i], a[j] = a[j], a[i]

    a[i+1], a[r] = a[r], a[i+1]
    return i+1


n = int(input())
a = list(map(int, input().split()))
idx = partition(0, n-1)
a[idx] = [a[idx]]
print(*a)

Measured memory_bytes: 18160
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let s1: Vec<char> = iterator.next().unwrap().chars().collect();
    let s2: Vec<char> = iterator.next().unwrap().chars().collect();

    let mut is_tate: Vec<bool> = Vec::new();
    let mut i = 0;
    while i < n {
        if s1[i] == s2[i] {
            is_tate.push(true);
        } else {
            is_tate.push(false);
            i += 1;
        }
        i += 1;
    }

    let mut ans: usize = if is_tate[0] {
        3
    } else {
        3 * 2
    };

    const MOD: usize = 1_000_000_007;
    for i in 1..is_tate.len() {
        if is_tate[i - 1] {
            ans *= 2;
        } else {
            if !is_tate[i] {
                ans *= 3;
            }
        }
        ans %= MOD;
    }

    ans.to_string()
}


Measured memory_bytes: 2108
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#include <functional>

using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main()
{
	int N,r=0;
	cin>>N;
	for(int i=1;i<=N;i++)
	{
		if(to_string(i).length()%2)
			r++;
	}
	cout<<r<<endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{	int n,k;
 cin>>n>>k;
 int i;
 int arr[n];
 for(i=0;i<n;i++)
 {
   cin>>arr[i];
 }
 sort(arr,arr+n);
 int sum=0;
  for(i=0;i<k;i++)
 {
   sum+=arr[i];
 }
 cout<<sum;
return 0;
}


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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(const T& value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(const T& value, const Ts&... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                        \
  do {                                  \
    cerr << #__VA_ARGS__ << ": ";       \
    debug(__VA_ARGS__);                 \
    cerr << " (L" << __LINE__ << ")\n"; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << '\n';
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

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

using ll = long long;

template <typename T>
using V = std::vector<T>;
template <typename T>
using VV = V<V<T>>;

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  in(int, a, b);
  out(max(a, b) <= 8 ? "Yay!" : ":(");
}


Measured memory_bytes: 3700
ceil = lambda a, b: (a + b - 1) // b

N, K = map(int, input().split())
A = tuple(map(int, input().split()))

# bisect
l, r = 0, max(A)
while r - l > 1:
    m = (l + r) // 2
    if sum(ceil(x, m) - 1 for x in A) > K:
        l = m
    else:
        r = m
print(r)


Measured memory_bytes: 31148
import sys
readline = sys.stdin.readline

N,W = map(int,readline().split())

import numpy as np
dp = np.zeros(W + 1, dtype = int)

for i in range(N):
  w,v = map(int,readline().split())
  np.maximum(dp[:-w] + v, dp[w:], out = dp[w:])
  
print(dp.max())

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


#define ll long long
#define lst(x) x.size()-1
#define ld long double
#define pr pair<ll,ll>
#define loop(i,n) for(int i=0 ; i<n ; ++i)
#define rep(i,x,n) for(int i=x ; i<=n ; ++i)
#define iteloop(type,data,name,it) for(type<data>::iterator it=name.begin() ;it!=name.end() ; ++it)

using namespace __gnu_pbds;
using namespace std;

template<typename T>
using os = tree<T, null_type, less_equal<T>, rb_tree_tag,
        tree_order_statistics_node_update>;

const ll N=2e5+5,M=1e1+5,MOD=1e9+7,OO=1e13;
int k,n,arr[N];
int main(){
    cin.sync_with_stdio(false), cin.tie(0) , cout.tie(0);
#ifndef ONLINE_JUDGE
  //  freopen("in.txt", "rt" , stdin);
    // freopen("in.txt", "wt" , stdout);
#endif // ONLINE_JUDGE
    cin>>n>>k;
    loop(i,n){
        cin>>arr[i];
    }
    sort(arr,arr+n);
    ll res=0;
    loop(i,n-k){
        res+=arr[i];
    }
    cout<<res<<endl;
}


Measured memory_bytes: 1024
#include<stdio.h>

int main()
{
  int N,i,j,flag,x,k = 0,A[100];

  scanf("%d",&N);

  for(i = 0;i < N;i++)
    scanf("%d",&A[i]);

  flag = 1;
  i = 0;

  while(flag)
    {
      flag = 0;
      for(j = N - 1;j >= i + 1;j--)
	{
	  if(A[j] < A[j - 1])
	    {
	      x = A[j];
	      A[j] = A[j - 1];
	      A[j - 1] = x;
	      flag = 1;
	      k++;
	    }
	}
      i++;
    }

  for(j = 0;j < N - 1;j++)
    {
      printf("%d ",A[j]);
    }
  printf("%d",A[N - 1]);
  printf("\n");
  printf("%d\n",k);

  return 0;
}
	  



Measured memory_bytes: 2140
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int sum = 0;
  for(int i = 0; i < 4; i++){
    int sec;
    cin >> sec;
    sum += sec;
  }
  cout << sum / 60 << endl;
  cout << sum % 60 << endl;

  return(0);
}

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

#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for (int i = (n); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main()
{
    string s;
    cin >> s;
    int cnt = 0;
    int ans = 0;
    rep(i, s.size())
    {
        if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
            cnt++;
        else
            cnt = 0;
        ans = max(ans, cnt);
    }

    OP(ans);
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
using std::cin;
using std::cout;
using std::endl;

int main(void) {
    cout << std::fixed << std::setprecision(10);
    std::string s;
    cin >> s;
    bool isAC = true;
    if (s[0] != 'A') {
        isAC = false;
    }
    int counter = 0;
    if ('a' > s[1] || s[1] > 'z') {
        isAC = false;
    }
    for (int i = 2; i < s.size() - 1; i++) {
        if (s[i] == 'C')
            counter++;
        else if ('a' > s[i] || s[i] > 'z') {
            isAC = false;
        }
    }
    if ('a' > s[s.size() - 1] || s[s.size() - 1] > 'z') {
        isAC = false;
    }
    if (counter != 1) {
        isAC = false;
    }
    if (isAC) {
        cout << "AC" << endl;
    } else {
        cout << "WA" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
using System;
namespace HelloWorld
{
    class Program
    {
        static void Main()
        {
            var counter = new int[100];
            string line;
            int max = -1;
            while ((line= Console.In.ReadLine())!=null)
            {
                ++counter[int.Parse(line) - 1];
            }

            foreach (var v in counter)
            {
                if (max < v)
                {
                    max = v;
                }
            }
            for (int i = 0; i < 100; ++i)
            {
                if (max == counter[i])
                {
                    Console.Out.WriteLine(i + 1);
                }
            }
        }
    }
}



Measured memory_bytes: 13864
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>

using ll = long long;

using namespace std;

ll mod=1e9+7;

int main() {
	int n;
	cin>>n;
	vector<pair<int,int>>red(n),blue(n);
	for(int i=0;i<n;i++){
		cin>>red[i].first>>red[i].second;
	}
	for(int i=0;i<n;i++){
		cin>>blue[i].first>>blue[i].second;
	}
	sort(red.begin(),red.end());
	sort(blue.begin(),blue.end());
	int ans=0;
	for(int i=0;i<n;i++){
		int idx=-1;
		for(int j=0;j<red.size();j++){
			if(red[j].first<=blue[i].first&&red[j].second<=blue[i].second){
				if(idx==-1){
					idx=j;
				}else if(red[idx].second<=red[j].second){
					idx=j;
				}
			}
		}
		if(idx!=-1){
			//cout<<red[idx].first<<" "<<red[idx].second<<"  "<<blue[i].first<<" "<<blue[i].second<<endl;
			ans++;
			red.erase(red.begin()+idx);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3604
alp=list("qwertyuiopasdfghjklzxcvbnm")
s=list(input())
out=[0]*len(alp)

for c in s:
  out[alp.index(c)]+=1
res="Yes"
for x in out:
  if x%2==1:
    res="No"
    break
    
print(res)

Measured memory_bytes: 2940
/* One original thought is worth a thousand mindless quotings */

#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<unordered_map>
#include<algorithm>
#include<bitset>
#include<queue>
#include <math.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout.precision(10);cout << fixed;
#define dbset(x) for(int i=0 ; i<x.size(); i++) cerr << x[i] << " "; cerr << endl;
#define inf 1000000007
#define INF 1000000000000000000LL
#define PI 3.14159265358979323846
#define mod 1000000007
#define mod1 1000696969
#define flusz fflush(stdout);
#define VI vector<int>
#define VPI vector < pair<int,int> >
#define PII pair<int, int>
#define BIT bitset<N>
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define endl '\n'
#define REP(x, y) for(int x = 0; x < (y); ++x)
#define FOR(x, y, z) for(int x = y; x <= (z); ++x)
#define FORR(x, y, z) for(int x = y; x >= (z); --x)
using namespace std;

template<class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<","; _dbg(sdbg+1, a...);
}
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)

#define int long long
const int N = 2000 + 7;

int test;

int n,m;

int g[N][N];

int G[N][N];

int dp[N*N],dp1[N*N];

int kol[N*N];

int czy[N*N];

bool zle;

int t[N*N];

void dfs(int v,int k){
	czy[v] = 1;
	t[k]++;
	kol[v] = k;

	FOR(i,1,n){
		if (G[v][i] == 1){
			if (czy[i] == 0){
				dfs(i,k^1);
			}else{
				if (kol[v] == kol[i])
					zle = 1;
			}
		}
	}
}

void dodaj(int x,int y){
	FOR(i,0,n){
		dp1[i] = 0;
	}

	FORR(i,n,0){
		if (dp[i]){
			dp1[i+x] = 1;
			dp1[i+y] = 1;
		}
	}

	FOR(i,0,n){
		dp[i] = dp1[i];
	}
}

int s(int x){
	return x*(x-1)/2;
}

void solve()
{	
	cin >> n >> m;

	FOR(i,1,m){
		int a,b;
		cin >> a >> b;

		g[a][b] = g[b][a] = 1;
	}

	FOR(i,1,n){
		g[i][i] = 1;
	}

	FOR(i,1,n){
		FOR(j,1,n){
			G[i][j] = g[i][j] ^ 1;
		}
	}

	dp[0] = 1;

	FOR(i,1,n){
		if (czy[i] == 0){
			t[0] = t[1] = 0;
			dfs(i,0);
			dodaj(t[0],t[1]);
		}
	}

	int res = INF;

	if (zle){
		cout << -1 << endl;
		return;
	}

	FOR(i,0,n){
		if (dp[i]){
			res = min(s(i) + s(n-i),res);
		}
	}

	cout << res << endl;;

    return;
}

int32_t main()
{
    boost

    test=1;

	for(int i=1; i <= test; i++){
        solve();
	}

    return 0;
}


Measured memory_bytes: 35072