akhauriyash/Code-Regression huggingface dataset:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def PL(L) : print(*L, sep="\n")

N, X, Y = LI()

ans = [0] * N

for i in range(1, N+1):
    for j in range(i, N+1):
        ans[min(j-i, abs(X-i)+1+abs(Y-j), abs(X-j)+1+abs(Y-i))] += 1

PL(ans[1:])


Measured memory_bytes: 46428
#include <iostream>
#include <cstring>
using namespace std;
bool t[1000000];
int main()
{
  memset(t,true,sizeof(t));
  t[0] = false;
  t[1] = false;
  for(int i=4; i<1000000; i+=2){
    t[i] = false;
  }
  for(int i=3; i*2<1000000; i+=2){
    if(!t[i]) continue;
    for(int j=i*2; j<1000000; j+=i){
      t[j] = false;
    }
  }
  for(;;){
    int a,d,n;
    cin >> a >> d >> n;
    if(a == 0 && d == 0 && n == 0) break;
    for(;;){
      if(t[a]) n--;
      if(n == 0){
        cout << a << endl;
        break;
      }
      a += d;
    }
  }
  return 0;
}

Measured memory_bytes: 2144
#include<iostream>
#include<cmath>
#include<stdio.h>
using namespace std;
int main() {
  int n=0;
  double ax,ay,bx,by,cx,cy,S,R,a,b,c,x,y;
  cin>>n;
  for(int i=0; i<n; i++){
    cin>>ax>>ay>>bx>>by>>cx>>cy;
    S=abs(((bx-ax)*(cy-ay)-(cx-ax)*(by-ay))/2);
    a=sqrt((cx-bx)*(cx-bx)+(cy-by)*(cy-by));
    b=sqrt((cx-ax)*(cx-ax)+(cy-ay)*(cy-ay));
    c=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
    R=a*b*c/(4*S);
    x=(a*a*(b*b+c*c-a*a)*ax+b*b*(c*c+a*a-b*b)*bx+c*c*(a*a+b*b-c*c)*cx)/(16*S*S);
    y=(a*a*(b*b+c*c-a*a)*ay+b*b*(c*c+a*a-b*b)*by+c*c*(a*a+b*b-c*c)*cy)/(16*S*S);
    printf("%.3f %.3f %.3f\n",x,y,R);
  }
}

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

const int mod = 2011;
vector<string> s;
vector<int> inv(mod,1);

inline int get_base(int l, int t, int b){
  FOR(i,t,b)if(s[i][l]!='.')return i;
  return t;
}

int expr(int &l, int &t, int &r, int &b);

int fraction(int &l, int &t, int &r, int &b){
  int base = t;
  FOR(i,t,b)if(s[i][l]!='.')base = i;

  int ll = l+1;
  while(++l < r && s[base][l]=='-');

  int ul = ll, ur = l-1, dl = ll, dr = l-1;
  int ut = t, ub = base, dt = base+1, db = b;
  return expr(ul,ut,ur,ub) * inv[expr(dl,dt,dr,db)] % mod;
}

int primary(int &l, int &t, int &r, int &b){
  int base = get_base(l,t,b);
  if(isdigit(s[base][l]))return s[base][l++]-'0';

  l+=2;
  int res = expr(l,t,r,b);
  l+=2;
  return res;
}

int powexpr(int &l, int &t, int &r, int &b){
  int res = primary(l,t,r,b);
  int base = get_base(l,t,b);

  if(l<r && isdigit(s[base][l])){
    int p = s[base][l]-'0';
    l++;
    int tmp = res; res = 1;
    while(p--) (res *= tmp) %= mod;
  }
  return res;
}

int factor(int &l, int &t, int &r, int &b){
  int base = get_base(l,t,b);

  if(s[base][l] == '-'){
    if(s[base][l+1] == '.'){
      l+=2;
      return mod - factor(l,t,r,b);
    }else return fraction(l,t,r,b);
  }
  return powexpr(l,t,r,b);
}

int term(int &l, int &t, int &r, int &b){
  int base = get_base(l,t,b);

  int res = factor(l,t,r,b);
  while(l+1<r && s[base][l+1]=='*'){
    l+=3;
    res = (res * factor(l,t,r,b)) % mod;
  }
  return res;
}

int expr(int &l, int &t, int &r, int &b){
  //remove spaces
  for(bool f=true;l<r;l++){FOR(i,t,b)f &= (s[i][l]=='.');   if(!f)break;}
  for(bool f=true;l<r;r--){FOR(i,t,b)f &= (s[i][r-1]=='.'); if(!f)break;}
  for(bool f=true;t<b;t++){FOR(i,l,r)f &= (s[t][i]=='.');   if(!f)break;}
  for(bool f=true;t<b;b--){FOR(i,l,r)f &= (s[b-1][i]=='.'); if(!f)break;}

  int base = get_base(l,t,b);

  int res = term(l,t,r,b);
  while(l+1<r && (s[base][l+1]=='+' || s[base][l+1]=='-')){
    l+=3;
    if(s[base][l-2]=='+')res = (res + term(l,t,r,b)) % mod;
    else res = (res - term(l,t,r,b) + mod) % mod;
  }
  return res;
}

int main(){
  cin.tie(); ios::sync_with_stdio(0);
  FOR(i,2,mod)inv[i] = (mod - mod/i) * inv[mod%i] % mod;

  int n;
  while(cin>>n,n){
    s.resize(n);
    FOR(i,0,n)cin >> s[i];

    int l = 0, t = 0, r = s[0].size(), b = n;
    cout << expr(l,t,r,b) << endl;
  }
}

Measured memory_bytes: 1232
import os, sys, re, math

N,D = map(int, input().split(' '))
x = []
for _ in range(N):
    temp = list(map(int, input().split(' ')))
    x.append(temp)

def isInt(n):
    base = 1
    while base ** 2 <= n:
        if base ** 2 == n:
            return True
        base += 1
    return False

cnt = 0
for i in range(N-1):
    for j in range(i+1,N):
        dist = 0
        for d in range(D):
            dist += (x[i][d] - x[j][d]) ** 2
        if isInt(dist):
            cnt += 1

print(cnt)


Measured memory_bytes: 3188
using System;
using System.Collections.Generic;

class A
{
    static void Main(string[] args)
    {
        string[] s = Console.ReadLine().Split(' ');
        int n = int.Parse(s[0]);
        int m = int.Parse(s[1]);

        bool[] f = new bool[n];
        int[] c = new int[n];

        for (int i = 0; i < m; i++)
        {
            string[] ss = Console.ReadLine().Split(' ');
            int j = int.Parse(ss[0]) - 1;
            string ac_wa = ss[1];
            if (f[j] == true)
            {
                continue;
            }
            if (f[j] == false && ac_wa == "WA")
            {
                c[j]++;
            }
            if (f[j] == false && ac_wa == "AC")
            {
                f[j] = true;
            }
        }

        int sum_ac = 0;
        int sum_wa = 0;

        for (int i = 0; i < n; i++)
        {
            if (f[i] == true)
            {
                sum_ac++;
                sum_wa += c[i];
            }
        }
        Console.WriteLine(sum_ac + " " + sum_wa);

    }
}

Measured memory_bytes: 15456
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define IP pair<int,int>
#define enld endl

int main() {
	vector<lint>A;
	A = {0,31,29,31,30,31,30,31,31,30,31,30,31 };
	vector<lint>S(13);
	S[0] = A[0];
	for (lint i = 1; i < 13; i++) {
		S[i] = S[i - 1] + A[i];
	}
	vector<string>B;
	B = { "Monday","Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };

	lint M, D;
	while (cin >> M >> D,!(M==0&&D==0)) {
		lint ALL = S[M - 1] + D;
		//cout << ALL << enld;
		cout << B[(ALL+2) % 7] << endl;
	}
}


Measured memory_bytes: 3100
x = int(input())
x100, r = divmod(x, 100)
q, r = divmod(r, 5)
c = q
q, r = divmod(r, 4)
c += q
q, r = divmod(r, 3)
c += q
q, r = divmod(r, 2)
c += q
q, r = divmod(r, 1)
c += q
if x100 >= c:
    print(1)
else:
    print(0)


Measured memory_bytes: 3064
#include <iostream>
#include<string>
#include<math.h>
#include<vector>
#include<algorithm>
#include<array>
#include<functional>
#include<iomanip>
#include<ios>
using namespace std;
#define FOR(i,n) for(int (i)=0;(i)<(n);(i)++)

typedef int value_type; /* ソートするキーの型 */

value_type med3(value_type x, value_type y, value_type z)
/* x, y, z の中間値を返す */
{
    if (x < y)
        if (y < z) return y; else if (z < x) return x; else return z; else
        if (z < y) return y; else if (x < z) return x; else return z;
}

void quicksort(value_type a[], int left, int right,value_type index[])
/* クイックソート
 * a     : ソートする配列 
 * left  : ソートするデータの開始位置
 * right : ソートするデータの終了位置
 * index: index配列
 */
{
    if (left < right) {
        int i = left, j = right;
        value_type tmp, pivot = med3(a[i], a[i + (j - i) / 2], a[j]); /* (i+j)/2ではオーバーフローしてしまう */
        while (1) { /* a[] を pivot 以上と以下の集まりに分割する */
            while (a[i] < pivot) i++; /* a[i] >= pivot となる位置を検索 */
            while (pivot < a[j]) j--; /* a[j] <= pivot となる位置を検索 */
            if (i >= j) break;
            tmp = a[i]; a[i] = a[j]; a[j] = tmp; /* a[i],a[j] を交換 */
            tmp = index[i]; index[i] = index[j]; index[j] = tmp;
            i++; j--;
        }
        quicksort(a, left, i - 1,index);  /* 分割した左を再帰的にソート */
        quicksort(a, j + 1, right,index); /* 分割した右を再帰的にソート */
    }
}


int dfs(int n,int N){
    if (n>N){
        return 0;
    }
    

    int ret;
    
    return ret;
}


struct AB{
    long long A;
    long long B;
    
};
int main(){
    int N,M;
    long long ans=0;
    vector<struct AB> q;
    cin >> N >>M;
    long long A[N],B[N];
    
    FOR(i,N){
        cin >> A[i]>>B[i];
        AB tmp={A[i],B[i]};
        q.push_back(tmp);
    }   

    sort(q.begin(),q.end(),[](const AB& x,const AB& y){return y.A>x.A;});
 
    int num=0;
    int po=0;
    while(num<M && M-num >= q[po].B){
        ans+=q[po].A * q[po].B;
        num+=q[po].B;
        po++;
        
        
    }
    ans+=q[po].A *(M-num);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3444
#include<stdio.h>
#define MAX 100000
#define SENTINEL 2000000000

struct Card {
  char suit;
  int value;
};

struct Card L[MAX / 2 + 2], R[MAX / 2 + 2];

void merge(struct Card A[], int n, int left, int mid, int right) {
  int i, j, k;
  int n1 = mid - left;
  int n2 = right - mid;
  for( i = 0; i < n1; i++ ) L[i] = A[left + i];
  for( i = 0; i < n2; i++ ) R[i] = A[mid + i];
  L[n1].value = R[n2].value = SENTINEL;
  i = j = 0;
  for ( k = left; k < right; k++ ) {
    if ( L[i].value <= R[j].value ) {
      A[k] = L[i++];
    } else {
      A[k] = R[j++];
    }
  }
}

void mergeSort(struct Card A[], int n, int left, int right){
  int mid;
  if ( left + 1 < right ) {
    mid = (left + right) / 2;
    mergeSort(A, n, left, mid);
    mergeSort(A, n, mid, right);
    merge(A, n, left, mid, right);
  }
}

int partition(struct Card A[], int n, int p, int r) {
  int i, j;
  struct Card t, x;
  x = A[r];
  i = p - 1;
  for ( j = p; j < r; j++ ) {
    if ( A[j].value <= x.value ) {
      i++;
      t = A[i]; A[i] = A[j]; A[j] = t;
    }
  }
   t = A[i + 1]; A[i + 1] = A[r]; A[r] = t;
   return i + 1;
}

void quickSort(struct Card A[], int n, int p, int r) {
  int q;
  if ( p < r) {
    q = partition(A, n, p, r);
    quickSort(A, n, p, q - 1);
    quickSort(A, n, q + 1, r);
  }
}

int main() {
  int n, i, v;
  struct Card A[MAX], B[MAX];
  char S[10];
  int stable = 1;

  scanf("%d", &n);

  for ( i = 0; i < n; i++) {
    scanf("%s %d", S, &v);
    A[i].suit = B[i].suit = S[0];
    A[i].value = B[i].value = v;
  }

  mergeSort(A, n, 0, n);
  quickSort(B, n, 0, n - 1);

  for ( i = 0; i < n; i++) {
    if ( A[i].suit != B[i].suit ) stable = 0;
  }

  if ( stable == 1 ) printf("Stable\n");
  else printf("Not stable\n");
  for ( i = 0; i < n; i++ ) {
    printf("%c %d\n", B[i].suit, B[i].value);
  }

  return 0;
}




Measured memory_bytes: 4072
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
#define FOR(i,k,n) for(int i=(k);i<(n);++i)

int main(){
    int N;cin >> N;
    ll T; cin >> T;
    vector<ll> t(N);
    FOR(i,0,N) cin >> t[i];
    t.push_back(INF);
    ll res =0;
    FOR(i,0,N){
        res += min(T,t[i+1]-t[i]);
    }
    cout << res << endl;
    return 0;
}

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

bool chk(string &s) {
    string t = s;
    reverse(begin(t), end(t));
    return t == s;
}

int main() {
    int n;
    string s, l, r;
    cin >> s;
    n = s.size();
    l = s.substr(0, n / 2);
    r = s.substr(n / 2 + 1, n / 2);
    if(chk(s) && chk(l) && chk(r)) cout << "Yes";
    else cout << "No";
    return 0;
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(A)  begin((A)),end((A))
#define RALL(A) (A).rbegin(), (A).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(A) int((A).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2018/03/11  Problem: ARC 091 C / Link: http://arc091.contest.atcoder.jp/tasks/arc091_c  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL N,A,B;

LL ans = 0LL;
LL sz, arr[1000005];

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

	cin >> N >>A >>B;

	if (N < A + B - 1 || N > A*B) {
		cout << "-1\n";
		return 0;
	}
	map<LL, int> compress;
	LL rem = N - (A + B - 1);
	sz = 0;
	for (LL i = B; i >= 1; i--) {
		arr[++sz] = i;
		compress[i];
	}
	for (LL i = 2; i <= A; i++) {
		arr[++sz] = i*B;
		compress[i*B];
		for (LL j = i*B - 1; j>(i - 1)*B&&rem>0; j--, rem--) {
			arr[++sz] = j;
			compress[j];
		}
	}

	int cc = 0;
	for (map<LL, int>::iterator it = compress.begin(); it != compress.end(); it++)
		it->second = ++cc;

	for (int i = 1; i <= N; i++)
		cout << compress[arr[i]] << " ";

	return 0;
}


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

typedef long long ijt;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define ff first
#define ss second
#define rep(i,n) for(int i = 0;i < n;i++)

const int mod = (int)1e9 + 7;
int add(int a,int b){
   return (a + b) % mod;
}
int subt(int a,int b){
   int res = a - b;
   if(res < 0) return (res + mod) % mod;
   else res % mod;
}
int mult(int a,int b){
   long long mul = (long long)a * (long long)b;
   mul %= (long long)mod;
   return (int)mul;
}

int dp[200020][2];
int main(void){
   
   string s;cin >> s;
   int n = s.size();
   int ans = 0;
   dp[0][0] = 1;
   for(int i = 0;i < n;i++){
      for(int j = 0;j < 2;j++){
         if(j == 1) dp[i+1][j] = add(dp[i+1][j],mult(dp[i][j],3));
         else{
            if(s[i] == '1'){
               dp[i+1][1] = add(dp[i+1][1],dp[i][j]);
               dp[i+1][0] = add(dp[i+1][0],mult(dp[i][j],2));
            }else{
               dp[i+1][0] = add(dp[i+1][0],dp[i][0]);
            }
         }
      }
   }
   for(int i = 0;i < 2;i++)ans = add(ans,dp[n][i]);
   printf("%d\n",ans);
   return 0;
}


Measured memory_bytes: 1280
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int , int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define mod 1000000007
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define repc(i, a, b, c) for (ll i = a; (c > 0 ? i < b : i > b) and c != 0; i += c)
// #define mp make_pair
#define fi first
#define si second
#define pb push_back
#define all(name) name.begin(), name.end()
#define ral(name) name.rbegin(), name.rend()
#define fact(n) rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod)
#define mod_in(a) power(a, mod - 2)
#define ncr(n, r) (n>=r?((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod):0LL)
#define deb(x) cerr << "[" << #x << " " << x << "]" << endl;
#define endl '\n'
// #define int ll
vector<ll> ft(1, 1LL);

/*======================================================================*/

int arr[105];
void solve(){
    int n, k;
    cin >> n >> k;
    rep(i, 0, k){
        int y;
        cin >> y;
        rep(j, 0, y){
            int x;
            cin >> x;
            arr[x] = 1;
        }
    }
    int ans = 0;
    rep(i,1, n+1)if(arr[i] == 0)ans++;
    cout << ans;
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}

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

using namespace std;

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

  string s;
  cin >> s;

  int ans = 0;
  int cnt = 0;
  for (int i = 0; i < 3; ++i) {
    if (s[i] == 'R') {
      ++cnt;
    } else {
      cnt = 0;
    }
    ans = max(ans, cnt);
  }

  cout << ans << '\n';

  return 0;
}


Measured memory_bytes: 3644
#include <cstdio>

bool b[26];

int main()
{
  char s[27];
  scanf("%s", s);
  for (char* p = s; *p; ++p)
  {
    if (b[*p - 'a'])
    {
      puts("no");
      return 0;
    }
    b[*p - 'a'] = true;
  }
  puts("yes");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define REP(i,n) for (lint i = 0; i < (n); i++)
#define REP1(i,n) for (lint i = 1; i < (n); i++)

lint N, K;
vector<lint> H;

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

    REP (i, N){
        lint h;
        cin >> h;
        H.push_back(h);
    }

    if (N <= K) {
        cout << 0 << endl;
        return 0;
    }

    sort(H.begin(), H.end());
    auto end_it = H.end();
    REP (i, K) {
        --end_it;
    }

    lint ans = 0;
    for (auto it = H.begin(); it != end_it; ++it) {
        ans += *it;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2420
#pragma region
#ifndef LOCAL_DEBUG
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#endif

#include <assert.h>
#include <math.h>

#include <algorithm>
#include <iomanip>
#include <iostream>
#include <set>
#include <vector>
#define pb push_back
#define f(i, a, b) for (int i = a; i < b; i++)
#define revf(i, b, a) for (int i = b; i >= a; i--)
#define all(v) v.begin(), v.end()
#define srt(v) sort(v.begin(), v.end())
#define revsrt(v) sort(v.rbegin(), v.rend())
#define sp << ' ' <<
#define en << '\n'
#define precision(x) cout << fixed << setprecision(x);
#define fio                \
  ios::sync_with_stdio(0); \
  cin.tie(0);              \
  cout.tie(0);

using namespace std;

template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &v) {
  os << "{" << v.first << ", " << v.second << "}" en;
  return os;
}

template <typename T>
ostream &operator<<(ostream &os, set<T> &v) {
  for (T t : v) os << t << " ";
  os en;
  return os;
}

template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  for (T t : v) os << t << " ";
  os en;
  return os;
}

template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  int n = v.size();
  for (int i = 0; i < n; i++) is >> v[i];
  return is;
}

#define int long long
#define pii pair<int, int>
#define float long double
#define vi vector<int>
#define vvi vector<vi>
#define vpii vector<pii>
#define vvpii vector<vpii>
#pragma endregion

int mod = 1e9 + 7;  // 998244353;
const int MAX = 1e5 + 5;

void preprocessing() {}

void solvetestcase() {
  int d, t, s;
  cin >> d >> t >> s;
  if (t * s >= d)
    cout << "Yes\n";
  else
    cout << "No\n";
}

#undef int
int main() {
  fio;
  preprocessing();

  int t = 1;
  // UNCOMMENT FOR TESTCASES	\
	cin >> t;

  f(T, 1, t + 1) {
    // UNCOMMENT FOR CODEJAM,HACKERCUP	\
		cout << "Case #" << T << ": ";
    solvetestcase();
    cout.flush();
  }

  return 0;
};

/*
    AUTHOR:     KUNAL TAWATIA
    EDUCATION:  INDIAN INSTITUTE OF TECHNOLOGY, JODHPUR
*/


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

typedef long long int ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define sz(x) int(x.size())
const ll mod = 1000000007;
const ll INF = 10010010010010010;

map<ll, int> prime_factor(ll N) {
    map<ll, int> RES;
    for (ll I = 2; I*I <= N; I++) {
        while (N%I == 0) {
            RES[I]++;
            N /= I;
        }
    }
    if (N != 1) RES[N] = 1;
    return RES;
}

int main() {
    ll a,b; cin >> a >> b;
    map<ll, int> ap = prime_factor(a);
    map<ll, int> bp = prime_factor(b);
    int ans = 1;
    for(auto itr = ap.begin(); itr != ap.end(); itr++) {
        if (bp[itr->first] != 0) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3572
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in) ;
	public static void main(String[]args) {
		Main m = new Main();
		m.run();
	}
	
	long MOD = 998244353;
	
	void run() {
		String s = sc.next();
		int n = s.length();
		
		int b[] = new int[n];
		int r[] = new int[n];
		for(int i = 0; i < n; i++) {
			b[i] = s.charAt(i) - '0';
			r[i] = 2 - b[i];
		}
		
		
		int bb[] = new int[2*n+1];
		int rr[] = new int[2*n+1];
		
		for(int i = 0 ; i < n ; i++) {
			bb[i + 1] = bb[i] + b[i];
			rr[i + 1] = rr[i] + r[i];
		}
		for(int i = 0 ; i < n ; i++) {
			bb[i+n+1] = bb[i+n];
			rr[i+n+1] = rr[i+n];
		}
		
		
		long dp[][] = new long[2*n+1][2*n+1];
		dp[0][0] = 1;
		
		for(int i = 0 ; i < 2*n ; i++) {
			for(int rc = 0; rc <= i ; rc++) {
				int bc = i-rc;
				
				if(rr[i+1] >= rc+1) {
					dp[rc+1][bc] += dp[rc][bc];
					dp[rc+1][bc] %= MOD;
				}
				if(bb[i+1] >= bc+1) {
					dp[rc][bc+1] += dp[rc][bc];
					dp[rc][bc+1] %= MOD;
				}
			}
		}
		System.out.println(dp[rr[n]][bb[n]] % MOD);
		
	}
	
}


Measured memory_bytes: 167232
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define pb push_back
#define xx first
#define yy second
#define FOR(i,a,b) for (ll i=(a); i<(b); i++)
#define FORD(i,a,b) for (ll i=ll(b)-1; i>=(a); i--)
int main() {
	ios::sync_with_stdio(false);

	ll N; cin >> N;
	ll K; cin >> K;
	ll Q; cin >> Q;

	vl pers(N,K);

	FOR(i,0,Q) {
		ll a; cin >> a;
		a--;
		pers[a]++;
	}
	FOR(i,0,N) {
		ll living = pers[i] - Q;
		if (living > 0) {
			cout << "Yes\n";
		} else {
			cout << "No\n";
		}
	}

	return 0;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    int a,b,c;
    cin>>a>>b>>c;
    if (a==b)
        cout<<c<<endl;
    else if (b==c)
        cout<<a<<endl;
    else if (a==c)
        cout<<b<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(long long int i = 0; i < n; i++)
#define _rep(i,m,n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;
const ll mod = 1000000007;

int main() {
    int a,b,k; cin >> a >> b >> k;
    vector<int> c;
    _rep(i,1,max(a,b) + 1){
        if(a % i == 0 && b % i == 0)c.push_back(i);
    }
    print(c[c.size() - k]);
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int A[5];
	rep(i,5) scan(A[i]);
	int ans=0,ans2=INF;
	rep(i,5) ans+=(A[i]/10+(A[i]%10!=0))*10;
	rep(i,5) ans2=(A[i]%10==0 ? min(ans2,ans) : min(ans2,ans-10+A[i]%10));
	prin(ans2);
	return 0;
}


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

int main(){
  int a,b,k,i,c=0,n;
  cin>>a>>b>>k;
  for(i=max(a,b);i>=1;i--){
    if(a%i==0 && b%i==0) c++;
    if(c==k){
      n=i;
      break;
    }
  }
    cout<<n<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdint.h>

int32_t main(void)
{
    uint32_t a;
    if (scanf("%u", &a) < 0) {
        return 1;
    }

    printf("%u", a + (a * a) + (a * a * a));
    fflush(stdout);

    return 0;
}


Measured memory_bytes: 1736
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 10;
const int MOD = 1000000007;

int main() {
	int n;
	while (cin >> n, n) {
		vector<char> c(n+1);
		FOR(i, 1, n) {
			cin >> c[i];
		}

		vi p(26 + 'A');
		int f = 0, s = 0;
		bool finish = false;
		FOR(i, 1, n) {
			p[c[i]]++;
			if (f < p[c[i]]) {
				f = p[c[i]];
				FOR(j, 'A', 'Z') {
					if (c[i] != j) {
						s = max(s, p[j]);
					}
				}
			}
			else if (f == p[c[i]] || s < p[c[i]]) {
				s = p[c[i]];
			}

			if (n - i + s < f) {
				char w;
				FOR(j, 'A', 'Z') {
					if (p[j] == f) {
						w = j;
					}
				}
				cout << w << " " << i << endl;
				finish = true;
				break;
			}
		}

		if (!finish) {
			cout << "TIE" << endl;
		}
	}
}

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

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

    if(s.at(0) == s.at(1) || s.at(0) == s.at(2) || s.at(1) == s.at(2)){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    double v;

    while (scanf("%lf", &v) != EOF) {
        double ans = v*v + 98.0;
        for (int i = 0; i < 500; i++) {
            if (ans <= 98 * i) {
                cout << i << endl;
                break;
            }
        }
    }

    return 0;
}


    

Measured memory_bytes: 3180
/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

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

ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}

ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}

//-----------------------ここから-----------

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

    if(c >= a && c <= b){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;
// stack
int main()
{
  string s;
  while(getline(cin, s)) {
    if(s[0] == '.' && s.length() == 1) return 0;
    stack<char> st;
    bool ok = true;
    FOR(i,0,s.length()) {
      if(s[i] == '(' || s[i] == '[') st.push(s[i]);
      if(s[i] == ')' || s[i] == ']') {
        if(st.empty()) {
          ok = false;
          break;
        }
        char c = st.top(); st.pop();
        if(s[i] == ')' && c == '[') {
          ok = false;
          break;
        }
        if(s[i] == ']' && c == '(') {
          ok = false;
          break;
        }
      }
    }
    if(!st.empty()) ok = false;
    puts(ok?"yes":"no");
  }
  return 0;
}

Measured memory_bytes: 3164
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int deg[N],dp[N],n,m,ans;
vector<int>v[N];
stack<int>st;
int main()
{
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		int a,b;
		cin>>a>>b;
		--a,--b;
		v[a].push_back(b);
		deg[b]++;
	}
	for(int i=0;i<n;i++)if(!deg[i])st.push(i);
	while(!st.empty())
	{
		int now=st.top();st.pop();
		for(int i=0;i<v[now].size();i++)
		{
			int to=v[now][i];
			dp[to]=max(dp[to],dp[now]+1);
			ans=max(ans,dp[to]);
			deg[to]--;
			if(!deg[to])st.push(to);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 6528
#include<bits/stdc++.h>
#define fo(i,a,b) for(int i= a ; i < b ; ++i)
#define rep(i,n) fo(i,0,n)
#define pln(n) printf("%lld",n)
#define sll(n) scanf("%lld",&n)
#define ss(n) scanf("%s",n)
#define vi vector < int >
#define ll long long
#define pii pair < ll , ll >
#define pb push_back
#define mp make_pair
#define ull unsigned long long
#define INF 0x3f3f3f3f
#define dbg(x) { cout<< #x << ": " << (x) << endl; }
#define dbg2(x,y) { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) << endl; }
#define dbg3(x,y,z) { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) <<" , "<< #z <<": "<<(z)<<endl; }
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define vll vector<long long>
#define vvll vector<vector<long long>>
#define vvvll vector<vector<vector<ll>>>
#define si set<int>
#define tr(c, it) \
for(decltype(c.begin()) it = c.begin(); it!= c.end(); it++)
#define pis pair<int,string>
#define present(c, x) (c.find(x) != c.end())
#define cpresent(c, x) (find(all(c),x) != c.end())
#define  ones(x)  __builtin_popcount(x)
using namespace std;


int main(){
    int n, m, q;
    cin >>n>>m>>q;
    int a[q];int b[q];int c[q];int d[q];
    fo(i,0,q){cin>>a[i]>>b[i]>>c[i]>>d[i];}
    int mx = 0;
    fo(i0,1,m+1)fo(i1,i0,m+1)fo(i2,i1,m+1)fo(i3,i2,m+1)fo(i4,i3,m+1)fo(i5,i4,m+1)fo(i6,i5,m+1)fo(i7,i6,m+1)fo(i8,i7,m+1)fo(i9,i8,m+1){
        int A[11];
        A[0] = 0;
        A[1] = i0;
        A[2] = i1;
        A[3] = i2;
        A[4] = i3;
        A[5] = i4;
        A[6] = i5;
        A[7] = i6;
        A[8] = i7;
        A[9] = i8;
        A[10] = i9;
        int sum  = 0;
        for(int i = 0; i < q; i++){
            if(A[b[i]] - A[a[i]] == c[i]){
                sum += d[i];
            }
        }
        mx = max(mx,sum);
    }
    cout << mx;


}

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

template<class T,class F>
struct segtree{
  int n;
  T e;
  F f;
  std::vector<T> dat;

  segtree(){}
  segtree(int sz,T _e,F _f):e(_e),f(_f){
    n = 1;
    while(n<=sz)n<<=1;
    dat.resize(2*n,e);
  }
  segtree(std::vector<T> const& v,T _e,F _f):e(_e),f(_f){
    build(v);
  }
  void build(std::vector<T> const& v){
    n = 1;
    int sz = v.size();
    while(n<=sz)n<<=1;
    dat.resize(2*n,e);
    for(int i=0;i<sz;++i){
      dat[i+n] = v[i];
    }
    for(int i=n-1;i>0;--i){
      dat[i] = f(dat[i<<1],dat[i<<1|1]);
    }
  }
  void set(int p,T v){
    for(dat[p+=n]=v;p>1;p>>=1){
      dat[p>>1] = f(dat[p],dat[p^1]);
    }
  }
  T query(int l,int r){
    T res = e;
    for(l+=n,r+=n;l<r;l>>=1,r>>=1){
      if(l&1){
        res = f(res,dat[l]);
        l++;
      }
      if(r&1){
        r--;
        res = f(res,dat[r]);
      }
    }
    return res;
  }
  T operator[](int k){
    return query(k,k+1);
  }
};

signed main(){

  int n;
  string s;
  cin>>n>>s;

  vector<int> a(n);
  for(int i=0;i<n;++i){
    a[i] = s[i]-'a';
  }

  using bits = bitset<26>;
  vector<bits> c(n);
  for(int i=0;i<n;++i){
    c[i].set(a[i]);
  }
  auto merge = [](auto& a,auto& b){
    return a|b;
  };
  bits id;

  segtree<bits,decltype(merge)> seg(c,id,merge);

  int q;
  cin>>q;
  while(q--){
    int com;
    cin>>com;
    if(com==1){
      int i;
      char c;
      cin>>i>>c;
      i--;
      bits t;
      t.set(c-'a');
      seg.set(i,t);
    }
    if(com==2){
      int l,r;
      cin>>l>>r;
      l--;r--;
      bits res = seg.query(l,r+1);
      cout<< res.count() <<endl;
    }
  }

}

Measured memory_bytes: 14980
#include<bits/stdc++.h>
#define int long long
#define double long double
#define vi vector<int>
#define vpi vector<pair<int,int> >
#define mii map<int,int>
#define mpi map<pair<int,int>,int>
#define msi map<string,int>
#define set set<int>
#define u_set unordered_set<int>
#define pb push_back
#define endl "\n"
#define ll long long int
#define vll vector<long long int>
#define vi vector<int>
#define vvi vector<vector<int>>
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define umap unordered_map 
#define mod 1000000007
#define fori(n) for(int i=0;i<n;i++)
#define forj(n) for(int j=0;j<n;j++)
using namespace std;
vvi dp(101,vi(100001,INT_MIN));
int n,w;
vi val(101),wt(101);

signed main()
{
    io
    cin >> n >> w;
    fori(n){
        cin >> wt[i] >> val[i];
    }
    dp[0][0] = w;
    dp[0][val[0]]  = w-wt[0];
    fori(n){
        dp[i][0] = w;
        forj(100001){
            if(i>0 && j >= val[i])
                dp[i][j] = max(dp[i-1][j] , dp[i-1][j-val[i]] - wt[i]);
            else if(i>0)
                dp[i][j] = dp[i-1][j];
        }
    }
    int ans = 0;
    fori(100001){
        if(dp[n-1][i] >= 0)ans = max(ans,i);
    }
    cout << ans << endl;
    return 0;
    
}

Measured memory_bytes: 80256
# -*- coding: utf-8 -*-
"""
Created on Mon Sep  7 02:42:25 2020

@author: liang
"""

"""
n進数問題
【原則】　大きな数の計算をしない
　⇒　１の桁から計算する
 
171-C いびつなn進数

27 -> a(26)a(1)となる
　⇒先にa(1)だけもらってN%26とすることで解決
 
ASCII化 ord()
文字化　chr()
"""

N = int(input())

res = str()

while N > 0:
    N -= 1 #"a"として予め設置
    res += chr(ord("a") + N%26)
    N //= 26

print(res[::-1])

Measured memory_bytes: 9064
#include "bits/stdc++.h"
using namespace std;

//

#define RESIDUE(u,v) (capacity[u][v] - flow[u][v])
#define RCOST(u,v) (cost[u][v] + h[u] - h[v])
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define LL long long

#define N 200000

LL a[N];

int main(){
  int n;
  cin>>n;
  REP(i,n)
    cin>>a[i];
  if(a[0]!=0){
    cout<<-1<<endl;
    return 0;
  }
  REP(i,n-1){
    if(a[i+1]>a[i]+1){
      cout<<-1<<endl;
      return 0;
    }
  }
  int idx=n-1,idx2=n-1;
  LL ret=0;
  while(idx>0){
    if(a[idx]==0){
      idx--;
      continue;
    }
    ret += a[idx];
    idx2 = idx-1;
    while(idx2>0){
      if(a[idx2] > a[idx]-(idx-idx2))
	break;
      idx2--;
    }
    idx = idx2;
  }
  
  cout<<ret<<endl;
  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    int h,w; cin >> h >> w;
    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];

    Graph g(h, vector<int> (w,0));
    int tmp = 0;
    int now = 0;
    

    rep(i,h){
        rep(j,w){

            if(tmp < a[now]){
                g[i][j] = now + 1;
                tmp++;
            }

            if(tmp == a[now]){
                tmp = 0;
                now++;
            }
        }
    }

    rep(i,h){

        if(!(i & 1)){
            rep(j,w){
                cout << g[i][j] << " ";
            }
        }

        if(i & 1){
            for(int j = w-1;j >= 0; j--){
                cout << g[i][j] << " ";
            }
        }
        cout << endl;

    }

}

Measured memory_bytes: 384
#include<iostream>
#include <list>
#include<stack>
#include<queue>
#include <vector>
#include <set>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include <functional>

#define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define LL long long
#define CLR(a) memset((a),0,sizeof(a))
#define SZ(x) (int((x).size()))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl
using namespace std;

const LL MOD = 1000000007;// 10^9+7
const int INF = (1 << 30);


//変数
LL N, A, B;
vector<LL> ans_;





//サブ関数
//入力
void input()
{
	cin >> N >> A >> B;
}

bool can(LL N, LL A, LL B) {
	if (A + B <= N + 1 && A*B >= N)return true;
	else return false;
}

//計算
void calc()
{
	if (!can(N, A, B)) {
		cout << "-1" << endl;
	}
	else if (min(A, B) == 1) {
		if (B == 1) {
			REP(i, N)cout << i + 1 << " ";
		}
		else {
			REP(i, N)cout << N - i << " ";
		}
		cout << endl;
	}
	else {
		vector<LL> res(A, B);
		LL sum = A * B;
		LL i = A;

		while (sum > N) {
			i--;
			res[i] = 1;
			sum -= B - 1;
		}
		while (sum < N) {
			res[i]++;
			sum++;
		}
		REP(i, A - 1)res[i + 1] += res[i];
		for (LL j = res[0]; j > 0; j--)cout << j << " ";
		REP(i, A - 1)
			for (LL j = res[i + 1]; j > res[i]; j--)cout << j << " ";
		cout << endl;

		/*
		vector<vector<int>> ans(B);
		int cnt = 1;
		REP(i, B) {
			REP(j, res[i]) {
				ans[i].push_back(cnt);
				cnt++;
			}
		}
		for (auto v : ans) {
			while (v.size() > 0) {
				cout << v.back() << " ";
				v.pop_back();
			}
		}
		cout << endl;
		*/
	}
}

//デバッグ
void debug()
{
	int N;
	cin>>N;
}


//メイン関数
int main()
{
	input();
	calc();
	debug();
	
	return 0;
}


Measured memory_bytes: 3584
object Main extends App {

  val Array(n, k) = scala.io.StdIn.readLine().split(" ").map(_.toInt)
  val s = scala.io.StdIn.readLine()


  def solve() =  {
    val arr = s.toArray
    arr(k-1) = arr(k-1) match {
      case 'A' => 'a'
      case 'B' => 'b'
      case 'C' => 'c'
    }
    arr.mkString("")
  }

  println(solve)

}


Measured memory_bytes: 27324
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    double theta = c / 180.0 * M_PI;
    double s = 0.5 * a * b * sin(theta);
    double l = sqrt(a*a + b*b - 2*a*b*cos(theta)) + a + b;
    double h = b * sin(theta);
    printf("%.8f\n", s);
    printf("%.8f\n", l);
    printf("%.8f\n", h);
}

Measured memory_bytes: 1180
#include <stdio.h>

int main(){
    int r, D, x[11], i;

    scanf("%d %d %d", &r, &D, &x[0]);

    for(i=0; i<10; i++){
        x[i+1] = r * x[i] - D;
        printf("%d\n", x[i+1]);
    }

    return 0;
}

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

#define FORE(i, a) for (auto i = a.begin(); i != a.end(); ++i)
#define REPU(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (a); i > (b); --i)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())

vector<string> split(const string &s, char c) {
	vector<string> v;
	stringstream ss(s);
	string x;
	while (getline(ss, x, c)) v.push_back(x);
	return v;
}

#define DEBUG(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }

void err(vector<string>::iterator it) {}

template<typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
	cerr << "[DEBUG] " << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n';
	err(++it, args...);
}

typedef long long ll;
const int MOD = 1000000007;

template<class T, class U> inline T tmin(T a, U b) { return (a < b) ? a : b; }
template<class T, class U> inline T tmax(T a, U b) { return (a > b) ? a : b; }
template<class T, class U> inline void amax(T &a, U b) { if (b > a) a = b; }
template<class T, class U> inline void amin(T &a, U b) { if (b < a) a = b; }
template<class T> inline T tabs(T a) { return (a > 0) ? a : -a; }
template<class T> T gcd(T a, T b) { while (b != 0) { T c = a; a = b; b = c % b; } return a; }

int main(int argc, char *argv[]) {
	ios_base::sync_with_stdio(false);

	string s; int n, a = 0, b = 0, rb = 0, A, B;

	cin >> n >> A >> B >> s;
	REPU(i, 0, n) {
		if (s[i] == 'a') {
			if (a + b < A + B) {
				a++; puts("Yes");
			}
			else puts("No");
		}
		else if (s[i] == 'b') {
			rb++;
			if (a + b < A + B && rb <= B) {
				b++; puts("Yes");
			}
			else puts("No");
		}
		else puts("No");
	}

	return 0;
}


Measured memory_bytes: 848
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef vector<vi> vvi;
const int MOD = 1e9 + 7;

#define fastIO \
ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define endl '\n'
#define pb push_back
#define ff first
#define ss second
#define mp make_pair 

#ifdef DIV_DEBUG
#define cerr(...) __cerr(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __cerr(const char *name, Arg1 &&arg1) {
    cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __cerr(const char *names, Arg1 &&arg1, Args&&... args) {
    const char *sep = strchr(names + 1, ',');
    cerr.write(names, sep - names) << " = " << arg1 << " |";
    __cerr(sep + 1, args...);
}
#else
#define cerr(...) 
#endif

ll _sieve_size;
vi fact;   // 10^7 should be enough for most cases
vi primes;

void sieve(ll upperbound) {
    _sieve_size = upperbound + 1;
    fact.assign(_sieve_size + 1, 0);
    iota(fact.begin(), fact.end(), 0);
    for (ll i = 2; i <= _sieve_size; i += 2)    fact[i] = 2;
    for (ll i = 3; i <= _sieve_size; i++) if (fact[i] == i) {
        for (ll j = i * i; j <= _sieve_size; j += i)
            if (fact[j] == j)   fact[j] = i;
        primes.pb(i);
    }
}

ll count(int n = 54) {
    if (n == 1) return 1;
    int ans = 1;
    int dup = fact[n];
    int c = 1;
    int j = n / fact[n];
    while (j != 1) {
        if (fact[j] == dup) ++c;
        else {
            dup = fact[j];
            ans = ans * (c + 1);
            c = 1;
        }
        j = j / fact[j];
    }
    ans *= (c + 1);
    return ans;
}

int main() {
    fastIO;
    int n;
    cin >> n;
    sieve(n);
    ll ans = 0;    
    for (int i = 1; i < n; i++) {
        ans += count(i);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 12012
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define mfill(x,y) memset(x,y,sizeof(x))
#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...) 42
#endif
#define y0 y12345
#define y1 y54321
typedef unsigned long ul;
typedef long long ll;
//typedef pair<int, int> mpair;
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(a>b){a=b;return 1;}return 0;}
using namespace std;

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
   	int n,m,l;cin>>n>>m>>l;
	cout <<m * (l/n) << endl;
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

public class Program
{
    private int H, N;
    private int[] A, B;

    public void Solve()
    {
        var sc = new Scanner();
        H = sc.NextInt();
        N = sc.NextInt();
        A = new int[N];
        B = new int[N];
        for (int i = 0; i < N; i++)
        {
            A[i] = sc.NextInt();
            B[i] = sc.NextInt();
        }

        // H減らすために必要な
        var dp = new long[H + 1];
        for (int i = 0; i <= H; i++)
        {
            dp[i] = long.MaxValue;
        }

        dp[0] = 0;
        for (int i = 0; i < N; i++)
        {
            for (int j = 0; j <= H; j++)
            {
                if (dp[j] == long.MaxValue) continue;
                int index = Math.Min(H, j + A[i]);
                dp[index] = Math.Min(dp[index], dp[j] + B[i]);
            }

            //Console.WriteLine(string.Join(" ",dp));
        }

        Console.WriteLine(dp[H]);
    }

    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 13180