akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>


int main(){
  char aaa[200009];
  
  scanf("%s", aaa);
  long long int ss = 0;
  
for (int j = 0; j < strlen(aaa); ++j){
    if (aaa[j] == '1')
      ss += 1;
    else if (aaa[j] == '2')
      ss += 2;
    else if (aaa[j] == '3')
      ss += 3;
    else if (aaa[j] == '4')
      ss += 4;
    else if (aaa[j] == '5')
      ss += 5;
    else if (aaa[j] == '6')
      ss += 6;
    else if (aaa[j] == '7')
      ss += 7;
    else if (aaa[j] == '8')
      ss += 8;
    else if (aaa[j] == '9')
      ss += 9;
    else
      ss += 0;
}
  
  //printf("%d\n", ss);
  
  if (ss % 9 == 0)
    printf("Yes\n");
  else
    printf("No\n");

  return 0;
}

Measured memory_bytes: 1776
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

const double pi = 3.14159265358979323846;
const int mod = 1000000007;

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

  cout << N*N - A << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main (){
  int a, b;
  cin >> a >> b;
  if ((a + b) % 2 == 0){
    cout << (a + b) / 2 << endl;
  }else{
    cout << (a + b + 1) / 2 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
static const int N=100;

int main() {
  int M[N][N];
  int n,u,k,v;
  cin>>n;
  for (int i=0; i<n; i++) 
    for (int j=0; j<n; j++) 
      M[i][j]=0;
  for (int i=0; i<n; i++) {
    cin>>u>>k;
    u--;
    for (int j=0; j<k; j++) {
      cin>>v;
      v--;
      M[u][v]=1;
    }
  }
  for (int i=0; i<n; i++) {
    for (int j=0; j<n; j++) {
      if (j) 
        cout<<" "<<flush;
      cout<<M[i][j]<<flush;
    }
    cout<<endl;
  }
  return 0;
}


Measured memory_bytes: 3148
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long int;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF = 1e9;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
int main(){
    int a[200005];
    int n;
    cin >> n;
    rep(i,n) cin >> a[i];
    sort(a,a+n);
    bool out = 0;
    rep(i,n-1){
        if (a[i] == a[i+1]) out = 1;
    }
    if (out) PRINT("NO");
    else PRINT("YES");
}

Measured memory_bytes: 1024
//created by Whiplash99
import java.io.*;
import java.util.*;
public class Main
{
    private static long evaluate(long a[], int N, long val)
    {
        long sum=0;
        for(int i=0;i<N;i++) sum+=a[i]^val;
        return sum;
    }
    public static void main(String[] args) throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        int i,N;

        String s[]=br.readLine().trim().split(" ");
        N=Integer.parseInt(s[0]);
        long K=Long.parseLong(s[1]);

        s=br.readLine().trim().split(" ");
        long[] a=new long[N];
        for(i=0;i<N;i++) a[i]=Long.parseLong(s[i]);

        long max=evaluate(a,N,0); long cur;
        for(cur=1;cur<=K;cur*=2){}

        cur/=2; long val=0; max=0;
        for(;cur>=1;cur/=2)
        {
            long tmp=evaluate(a,N,cur);
            if(val+cur<=K&&evaluate(a,N,val+cur)>max)
            {
                max=evaluate(a,N,val+cur);
                val+=cur;
            }
            if(tmp>max)
            {
                max=tmp;
                val=cur;
            }
        }

        max=Math.max(max,evaluate(a,N,0));
        max=Math.max(max,evaluate(a,N,K));
        System.out.println(max);
    }
}

Measured memory_bytes: 49312
package main

import (
  "fmt"
)

func main() {
  var n, a, b int

  fmt.Scanf("%d %d %d", &n, &a, &b)

  sum := 0
  for i:=1; i<=n; i++ {
    x := getSum(i)
    if a <= x && x <= b { sum += i }
  }
  fmt.Print(sum)
}

func getSum(x int) int {
  sum := 0
  for {
    if x == 0 { break }
    sum += x % 10
    x /= 10
  }

  return sum
}

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

using namespace std;

int main(){
    string S;
    bool conv = 1;

    cin >> S;

    for(int i=0;i<S.size();i+=2){
        
        if(S[i]=='L'){
            conv = 0;
            break;
        }
    }

    for(int i=1;i<S.size();i+=2){

        if(S[i] =='R'){
            conv =0;
            break;
        }
    }

    if(conv){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    string s, t;
    cin >> s >> t;
    int ans = 10000, num;
    int n = s.length();
    int m = t.length();
    for(int i=0;i<=n-m;i++){
        num = 0;
        for(int j=0;j<m;j++){
            if(s[i + j] != t[j]) num++;
        }
        ans = min(ans, num);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3588
#include<iostream>
#include<algorithm>
#include<cstring>
#include<math.h>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<vector>
int az[26];
using namespace std;
int main() {
	
	string s;
	int n;
	cin >> n;
	int i, j, k;
	
	for (j = 0; j < 26; j++) {
		az[j] = 100;
	}
	for (i = 0; i < n; i++) {
		cin >> s;
		for (j = 0; j < 26; j++) {
			k = count(s.cbegin(), s.cend(), 'a' + j);
			az[j] = min(k, az[j]);
		}
	}
	char c;
	for (i = 0; i < 26; i++) {
		for (j = 0; j < az[i]; j++) {
			c =  'a' + i;
			cout << c;	
		}
	}
	cout << endl;
	return 0;

}

Measured memory_bytes: 3612
use std::cmp;

fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let s: Vec<usize> = sc
        .chars()
        .into_iter()
        .map(|c| c as usize - 'a' as usize)
        .collect();
    let n = s.len();
    let mut prefix_dp = vec![n as u32; 1 << 26];

    let mut cur: usize = 0;
    for c in s.into_iter() {
        cur ^= 1 << c;
        if cur.count_ones() <= 1 {
            prefix_dp[cur] = 1;
        } else {
            let mut min = prefix_dp[cur];
            for i in 0..26 {
                let suffix = 1 << i;
                let prefix = cur ^ suffix;
                min = cmp::min(min, prefix_dp[prefix] + 1);
            }
            prefix_dp[cur] = min;
        }
    }

    println!("{}", prefix_dp[cur]);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 268668
#include <bits/stdc++.h>
typedef long long ll;
#define mod 1000000007
#define INF 1000000000
#define endl "\n"
#define all(s) s.begin(),s.end()
#define pb push_back
#define uno unordered_map
#define pi 3.1415926536
#define dig(a) fixed<<setprecision(a)
#define test(zz) int zz; cin>>zz; while(zz--)
#define foreach(var,i) for(auto i = var.begin();i!=var.end();i++)
#define fast() ios_base::sync_with_stdio(false); cin.tie(NULL);
ll power(ll a, ll n) {ll res = 1; while (n) {if (n % 2) {res *= a;} n >>= 1; a *= a;} return res;}
ll powerm(ll a, ll n, ll m) {ll res = 1; while (n) {if (n % 2) {res = (res * a) % m;} n >>= 1; a = (a * a) % m;} return res;}
using namespace std;
int main(){
	fast();
	//test(t){}
	int x;cin>>x;
	cout<<(x>=30?"Yes":"No");
	return 0;
}


Measured memory_bytes: 3668
import java.io.*;

public class Main{
public static void main(String[] args) {
	BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); 
	try {
		String line = reader.readLine();
		int x = Integer.parseInt(line);
		int y;
		y=x*x*x;
		System.out.println(y);
		} catch (IOException e) { 
			System.out.println(e);
		} catch (NumberFormatException e) { 
			System.out.println("error\n");
		}
}
}

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

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

Measured memory_bytes: 14032
/**
 *    author:  Atreus
**/
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
const int maxn = 300 + 10;

ld dp[maxn][maxn][maxn];

int main(){
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	int a = 0, b = 0, c = 0;
	for (int i = 1; i <= n; i++){
		int x;
		cin >> x;
		if (x == 1)
			a ++;
		if (x == 2)
			b ++;
		if (x == 3)
			c ++;
	}
	for (int i = 0; i <= n; i++){
		for (int j = 0; j <= n - i; j++){
			for (int k = 0; k <= n - i - j; k++){
				if (i + j + k == 0)
					continue;
				dp[i][j][k] = 1;
				if (i > 0){
					ld prob = 1. * i / n;
					dp[i][j][k] += prob * dp[i - 1][j + 1][k];
				}
				if (j > 0){
					ld prob = 1. * j / n;
					dp[i][j][k] += prob * dp[i][j - 1][k + 1];
				}
				if (k > 0){
					ld prob = 1. * k / n;
					dp[i][j][k] += prob * dp[i][j][k - 1];
				}
				dp[i][j][k] *= 1. * n / (i + j + k);
			}
		}
	}
	cout << fixed << setprecision(9) << dp[c][b][a] << endl;
}


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

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

    if (a < b) cout << "a < b" << endl;
    if (a == b) cout << "a == b" << endl;
    if(a > b) cout << "a > b" << endl;

    return 0;
}


Measured memory_bytes: 3084
/* 
Rohit645
Rohit Kumar 
*/

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using db = double;
using pll = pair < ll, ll >;

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1) {
	cerr << name << " : " << arg1 << std :: endl;
}
template < typename Arg1, typename... Args >
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | ";
	__f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end() 
#define fastIo() ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0)

const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e5 + 10;

int main() {
	fastIo();
	int n; cin >> n;
	cout << 3*n*n << endl;;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <cstring>
#include <string>
using namespace std;
priority_queue<string>q;
const int maxn = 2e5 + 10;
string s[maxn];
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> s[i];
		q.push(s[i]);
	}
	int cnt = 1;
	string last;
	last = q.top();
	q.pop();
	while(!q.empty ())
	{
		if (last!=q.top ())
		{
			cnt++;
			last = q.top();
		}
		q.pop();
	}
	cout << cnt << endl;
	return 0;
}

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

namespace AtCoder2 {
	class Program {
		static void Main(string[] args) {

		var inputArray = retreiveLongArray();
			var inputCount = 3;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			long H = inputArray[0];
			long W = inputArray[1];
			long K = inputArray[2];

			var map = new bool[H, W];

			for (int i = 0; i < H; i++) {
				var inpArray = retreiveStringArray()[0];
				for (int j = 0; j < W; j++) {
					map[i, j] = inpArray[j] == '#';
				}
			}

			long count = 0;
			//ビット全探索
			for (int hPattern = 0; hPattern < Math.Pow(2, H); hPattern++) {
				for (int wPattern = 0; wPattern < Math.Pow(2, W); wPattern++) {
					var testmap = new bool[H, W];
					//検証用の地図を作成する
					for (int i = 0; i < H; i++) {
						for (int j = 0; j < W; j++) {
							testmap[i, j] = map[i,j];
						}
					}

					for (int i = 0; i < H; i++) {
						var x = (hPattern >> i) & 1;
						if (x==1) {//1のとき、すべて赤にする
							for (int j = 0; j < W; j++) {
								testmap[i, j] = false;
							}
						}
					}

					for (int j = 0; j < W; j++) {
						var y = (wPattern >> j) & 1;
						if (y == 1) {//1のとき、すべて赤にする
							for (int i = 0; i < H; i++) {
								testmap[i, j] = false;
							}
						}
					}

					//testMapの黒の数を数える
					var kuroCount = 0;
					for (int i = 0; i < H; i++) {
						for (int j = 0; j < W; j++) {
							if (testmap[i,j]) {
								kuroCount++;
							}
						}
					}
					if (kuroCount == K) {
						count++;
					}
				}
			}

			//答えの出力
			var ans = count;
			Console.WriteLine(ans);

		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}
	}
}


Measured memory_bytes: 28884
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
 
template<class T> inline bool chmax(T &a, T b){
    if(a<b){
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmin(T &a, T b){
    if(a>b){
        a = b;
        return true;
    }
    return false;
}
int a[]={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};
int main(){
    int k;
    cin >> k;
    k--;
    cout << a[k] << endl;
    return 0;
}

Measured memory_bytes: 888
#include <stdio.h>

int height(int idx) {
	return (idx * idx + idx) / 2;
}

int main() {

	int a, b;
	scanf("%d %d", &a, &b);

	int idx = b - a - 1;

	printf("%d\n", (height(idx) - a));

	return 0;
}


Measured memory_bytes: 128
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if (b-a) > k or (c-a) > k or (d-a) > k or (e-a) > k or (c-b) > k or (d-b) > k or (e-b) > k or (d-c) > k or (e-c) > k or (e-d) > k:
  print(':(')
else:
  print('Yay!')


Measured memory_bytes: 3064
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


ll N;
string Zaki,rev_Zaki,O,rev_O;

ll mod_pow(ll x,ll count, ll mod){

	if(count == 0)return 1;
	ll ret = mod_pow((x*x)%mod,count/2,mod);
	if(count%2 == 1){

		ret = (ret*x)%mod;
	}
	return ret;
}

int main(){

	cin >> Zaki;
	rev_Zaki = Zaki;
	reverse(rev_Zaki.begin(),rev_Zaki.end());

	cin >> O;
	rev_O = O;
	reverse(rev_O.begin(),rev_O.end());

	cin >> N;

	if(O.size() < N){

		if(Zaki+rev_O != O+rev_Zaki){

			printf("0\n");
		}else{

			printf("%lld\n",mod_pow(26,(N-O.length()+1)/2,MOD));
		}

	}else{

		string O_N(rev_O.begin(),rev_O.begin()+N);
		string line = O_N+Zaki+O_N+O;
		string rev_line = line;
		reverse(rev_line.begin(),rev_line.end());

		if(line == rev_line){

			printf("1\n");
		}else{

			printf("0\n");
		}
	}

	return 0;
}



Measured memory_bytes: 4248
#include<iostream>
using namespace std;
 
int main(){
        int x,y;
        while(cin>>x>>y,x){
                int D[16][16],P[16][16],ans=0;
                for(int i=0;i<256;i++)P[i/16][i%16]=0;
                for(int i=0;i<y;i++)for(int j=0;j<x;j++)cin>>D[i][j];
                for(int i=0;i<x;i++)if(!D[0][i])P[0][i]=1;
                for(int i=0;i<y-1;i++){
                        for(int j=0;j<x;j++){
                                if(!D[i][j]){
                                        P[i+1][j]+=P[i][j];
                                        if(j>0 && !D[i + 1][j - 1])P[i+1][j-1]+=P[i][j];
                                        if(j<x-1 && !D[i + 1][j + 1])P[i+1][j+1]+=P[i][j];
                                }
                                if(D[i][j]==2){
//                                        if(i+2>y-1)P[i+1][j]+=P[i][j];
                                        P[i+2][j]+=P[i][j];
                                }
                        }
                }
                for(int i=0;i<x;i++){
                    if (D[y - 1][i] != 1) ans+=P[y-1][i];
                    if (y >= 2 && D[y - 2][i] == 2) ans += P[y - 2][i];
                }
                cout<<ans<<endl;
        }
}
 

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#define N 102
using namespace std;
int n;
int a[N];
int main() {
  cin>>n;
  int tot=0;
  for (int i=0; i < n; ++i) {
  	cin>>a[i];
    tot += a[i];
  }
  int x1 = tot/n;
  int x2 = (tot+n-1)/n;
  int res1=0;
  int res2=0;
  for (int i =0; i < n; ++i) {
  	int det=a[i]-x1;
    int det2=a[i]-x2;
    res1 += det*det;
    res2 += det2*det2;
  }
  cout<<min(res1, res2)<<endl;
  return 0;
}

Measured memory_bytes: 256
using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System;

public class P
{
	public int x { get; set; }
	public int y { get; set; }
	public int p { get; set; }
}

public class P2
{
	public int step { get; set; }
	public int x { get; set; }
	public int y { get; set; }
}

public class hello
{
	static int[] dx, dy, d2x, d2y;
	static int h, w, ax, ay, bx, by;
	public static void Main()
	{
		dx = new int[] { 0, 0, 1, 0, 0, 0, 0, 0, -1 };
		dy = new int[] { 0, 0, 0, 0, -1, 0, 1, 0, 0 };
		d2x = new int[] { 0, 1, 0, -1 };
		d2y = new int[] { 1, 0, -1, 0 };

		while (true)
		{
			string[] line = Console.ReadLine().Trim().Split(' ');
			h = int.Parse(line[0]);
			w = int.Parse(line[1]);
			if (h == 0 && w == 0) break;
			var map = new bool[h, w];
			ax = 0; ay = 0; bx = 0; by = 0;
			for (int i = 0; i < h; i++)
			{
				var s = Console.ReadLine().Trim();
				for (int j = 0; j < w; j++)
				{
					map[i, j] = true;
					if (s[j] == 'A') { ax = i; ay = j; }
					else if (s[j] == 'B') { bx = i; by = j; }
					else if (s[j] == '#') map[i, j] = false;
				}
			}
			var ptn = Console.ReadLine().Trim();
			var d = getB(ptn);
			var amap = getAmap(map);
			getAns(amap, d);
		}
	}
	static void getAns(int[,] amap, Dictionary<int, P> d)
	{
		var anstime = int.MaxValue;
		var ansx = 0; var ansy = 0;
		var imax = Max(d.Count(), h * w);
		for (int i = 1; i < d.Count(); i++)
		{
			var bx = d[i].x;
			var by = d[i].y;
			if (amap[bx, by] != 999999 && amap[bx, by] <= i)
			{
				var abtime = Max(i, amap[bx, by]);
				if (abtime < anstime)
				{
					anstime = abtime;
					ansx = bx;
					ansy = by;
				}
			}
		}
		if (anstime == int.MaxValue) Console.WriteLine("impossible");
		else Console.WriteLine("{0} {1} {2}", anstime, ansx, ansy);
	}
	static int[,] getAmap(bool[,] map)
	{
		var amap = new int[h, w];
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++) amap[i, j] = 999999;
		var q = new Queue<P2>();
		q.Enqueue(new P2 { x = ax, y = ay ,step = 0});
		amap[ax, ay] = 0;
		while (q.Count() > 0)
		{
			var t = q.Dequeue();
			for (int i = 0; i < 4; i++)
			{
				var nx = t.x + d2x[i];
				var ny = t.y + d2y[i];
				if (nx >= 0 && nx < h && ny >= 0 && ny < w && map[nx, ny] && amap[nx, ny] == 999999)
				{
					q.Enqueue(new P2 { x = nx, y = ny, step = t.step + 1 });
					amap[nx, ny] = t.step + 1;
				}
			}
		}
		return amap;
	}
	static Dictionary<int, P> getB(string ptn)
	{
		var x = bx;
		var y = by;
		var d = new Dictionary<int, P>();
		var p = 0;
		var L = ptn.Length;
		d[0] = new P { x = x, y = y, p = -1 };
		var step = 1;
		var stepmax = Max(h * w, (L + 1) * (L + 1));
		while (step < stepmax)
		{
			var i = ptn[p] - '0';
			var nx = x + dx[i];
			var ny = y + dy[i];
			if (nx >= 0 && nx < h && ny >= 0 && ny < w)
			{
				d[step] = new P { x = nx, y = ny, p = p };
				x = nx;
				y = ny;
			}
			else
				d[step] = new P { x = x, y = y, p = p };
			p++;
			if (p == L) p = 0;
			step++;
		}
		return d;
	}
}



Measured memory_bytes: 18828
#include <bits/stdc++.h>
using namespace std;
int main(){
  int X, N;
  cin >> X >> N;
  set<int> st;
  for (int i = 0; i < N; i++){
    int p;
    cin >> p;
    st.insert(p);
  }
  int d = 0;
  while (1){
    if (!st.count(X - d)){
      cout << X - d << endl;
      break;
    }
    if (!st.count(X + d)){
      cout << X + d << endl;
      break;
    }
    d++;
  }
}

Measured memory_bytes: 3632
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);++i)
#define all(i,n) (i),(i+n)

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

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;

// --------------------------------------
string s;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> s;
  int sc = s.size();

  int zero = 0;
  int zero_sum = 0;
  int one = 1;
  int one_sum = 0;
  REP(i, sc) {
    int sn;
    if(s[i] == '0') {
      sn = 0;
    } else {
      sn = 1;
    }
    if(sn == zero) {
      one_sum++;
    } else {
      zero_sum++;
    }

    zero = zero ^ 1;
    one = one ^ 1;
  }

  cout << min(zero_sum, one_sum) << endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <limits>
#include <numeric>
#include <cmath>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define sz(x) int(x.size())

typedef long long ll;

using namespace std;

static const int MAX = 100001;

/******* c++14 don't includes *******/

template<typename T>
T gcd(T a, T b){if( b == 0)return a; return gcd(b, a%b); }
template<typename T>
T lcm(T a, T b){return a*b/gcd(a,b); }

/*******                      *******/

int main(int argc, const char * argv[]) {
    // input from txt
    
    /////////
    //write//
    /////////
    
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    
    ll all = b-a+1;
    ll c_all = b/c - (a-1)/c;
    ll d_all = b/d - (a-1)/d;
    ll x = max(c, d);
    ll y = min(c, d);
    ll cd = lcm(c, d);
    ll cd_all = b/cd - (a-1)/cd;
    all -= c_all + d_all - cd_all;
    
    cout << all << endl;
    
    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAX 150
void trace(int *A, int n){
    for(int i=0;i<n;i++){
        if(i > 0) printf(" ");
        printf("%d",A[i]);
    }
    putchar('\n');
}


void selectionSort(int *A, int n){
    int minj;
    int counter=0;
    for(int i=0;i<n;i++){
        minj = i;
        for(int j=i;j<n;j++){
            if(A[minj] > A[j]){
                minj = j;
            }
        }
        if(minj !=i){
        swap(A[minj],A[i]);
        counter++;
        }
    }
    trace(A,n);
    printf("%d\n",counter);
}

int main(){
    int n;
    int A[150];

    cin >> n;
    for(int i=0;i<n;i++){
        cin >> A[i];
    }
    selectionSort(A,n);
    return 0;
}


Measured memory_bytes: 3192
#include<iostream>

using namespace std;
int N,ans;

void dfs(long long x, bool flag3, bool flag5, bool flag7)
{if(x > N){return ;}
 if(flag3 && flag5 && flag7){ans++;}
 
 dfs(10*x + 3, true, flag5,flag7);
 dfs(10*x + 5, flag3, true, flag7);
 dfs(10*x + 7, flag3, flag5, true);
}

int main()
{cin >> N; 
 ans = 0;
 dfs(0,0,0,0);
 cout << ans << endl;
 return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << 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;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int ta = (c+b-1)/b;
    int ao = (a+d-1)/d;
    Yes(ta <= ao);
}

Measured memory_bytes: 3656
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//変数宣言
		int H = 1;
		int W = 1;


		while(true) {
			//HとWを手動入力
			H = sc.nextInt();
			W = sc.nextInt();

			//HとWがともに0のとき、処理を抜ける
			if(H == 0 && W == 0) {
				break;
			}

			//図形作成
			for(int i=0; i<H; i++) {
				for(int j=0; j<W; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();

		}


	}

}



Measured memory_bytes: 34884
n = int(input())
a = list(map(int, input().split()))
p=0
f=0
for ai in a:
    if ai%2==1:
        p+=1
    else:
        if ai/2%2==0:
            f+=1
if p==0:
    print('Yes')
elif p>f:
    if n%2==1 and 2*f+1==n:
        print('Yes')
    else:
        print('No')
else:
    print('Yes')


Measured memory_bytes: 14252
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

int main() {
    int N;
    cin >> N;
    vector<int> V(N);
    rep(i,N) cin >> V.at(i);
    vector<int> C(N);
    rep(i,N) cin >> C.at(i);

    int sum = 0;
    rep(i,N) {
        int D = V[i] - C[i];
        if (D > 0) sum += D;
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> l(n);
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> l.at(i);
    }

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            for (int k = 0; k < n; k++)
            {
                if (i<j && j<k)
                {
                    if(l[i]!=l[j] && l[i]!=l[k] && l[k]!=l[j])
                    {
                        if((long long) l[i]+l[j]+l[k] > max(max(l[i], l[j]), l[k])*2)
                        {
                            ans++;
                        }

                    }
                }
                
            }
            
        }
        
    }
    
    cout << ans << endl;
    
}

Measured memory_bytes: 3588
n, m, x  = map(int, input().split())
C = []
for i in range(n):
    C.append(list(map(int, input().split())))

ans = (12 * (10**5)) + 1

for i in range(1, 2**n):
    money = 0
    skill = [0]*m
    for j in range(n):
        if (i >> j) & 1:
            money += C[j][0]
            for k in range(1, m+1):
                skill[k-1] += C[j][k]
    # スキルがx以上になったか判定する
    t = 0
    for sk in skill:
        if sk < x:
            t += 1
    if t == 0:
        ans = min(ans, money)
    # print(i, skill, money)

if ans < (12 * (10**5)) + 1:
    print(ans)
else:
    print(-1)


Measured memory_bytes: 9232
#include<bits/stdc++.h>
using namespace std;
int main(){
	char c;
	int s=0,x;
	while(cin>>c){
		x=int(c-'0');
		s+=x;
		if(s>8)s-=9;
	}
	if(s==0)cout<<"Yes";
	else cout<<"No";
	return 0;
}

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

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie();
    cout.tie();
    string s;
    cin>>s;
    int n=s.size()-1;
    if(s[n]=='2' || s[n]=='4'||s[n]=='5'||s[n]=='7'||s[n]=='9') cout<<"hon";
    else if(s[n]=='0'|| s[n]=='1'|| s[n]=='6'||s[n]=='8') cout<<"pon";
    else cout<<"bon";

    return 0;
}

Measured memory_bytes: 3564
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
	cout << fixed << setprecision(10);
	int n;
	cin >> n;
	map<int,int> mii;
	rep(i,n){
		int x;
		cin >> x;
		mii[x]++;
		mii[x+1]++;
		mii[x-1]++;
	}
	vector<pair<int,int>> vpi;
	for(auto u : mii){
		vpi.push_back({u.second,u.first});
	}
	sort(vpi.rbegin(),vpi.rend());
	cout << vpi[0].first << endl;
	return 0;
}

Measured memory_bytes: 5880
sd=input()
t=input()

startpoint=51

for i in range(len(sd)-len(t)+1):
	proflag=True
	
	for j in range(len(t)):
		if sd[i+j] == "?":
			continue
		elif sd[i+j] == t[j]:
			continue
		else:
			proflag=False
	if proflag:
		startpoint=i
		



if startpoint == 51:
	print("UNRESTORABLE")
else:
	sd=sd.replace('?','a')
	print(sd[:startpoint]+t+sd[startpoint+len(t):])

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string w;
  cin >> w;
  map<char, int> cnt;
  for(int i = 0; i < w.length(); i++) cnt[w[i]]++;
  string ans = "Yes";
  for(auto q: cnt){
    if(q.second%2 == 1) ans = "No";
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define endl '\n'
#define pii pair<int,int>
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define all(x) x.begin(),x.end()
#define fill(a,b) memset(a,b,sizeof(a))
#define sz(x) (int)x.size()
#define sp(x) setprecision(x)
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define bs binary_search

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    string s; cin>>s;
    ll k,n=sz(s); cin>>k;
    ll ans=0;
    if(k==1){
        ans=(n-1)*9+s[0]-'0';
    }
    else if(k==2){
        if(n<2) ans=0;
        else{
            int idx=-1;
            for(int i=1;i<n;i++){
                if(s[i]!='0'){
                    idx=i;
                    break;
                }
            }
            ans=9*9*(((n-1)*(n-2))/2);
            ans+=((s[0]-'0'-1)*(n-1)*9);
            if(idx!=-1){
                ans+=((n-1-idx)*9);
                ans+=(s[idx]-'0');
            }
        }
    }
    else{
        if(n<3) ans=0;
        else{
            int idx1=-1,idx2=-1;
            for(int i=1;i<n;i++){
                if(s[i]!='0'){
                    idx1=i;
                    break;
                }
            }
            ans=((((n-1)*(n-2)*(n-3))/6)*9*9*9);
            ans+=((s[0]-'0'-1)*(((n-1)*(n-2))/2)*9*9);
            if(idx1!=-1){
                ans+=((((n-1-idx1)*(n-2-idx1))/2)*9*9);
                if(s[idx1]>'0') ans+=((s[idx1]-'0'-1)*(n-1-idx1)*9);
                for(int i=idx1+1;i<n;i++){
                    if(s[i]!='0'){
                        idx2=i;
                        break;
                    }
                }
                if(idx2!=-1){
                    ans+=((n-1-idx2)*9);
                    ans+=(s[idx2]-'0');
                }
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B, C):

    int(math.sqrt(A))
    if C - (A+B) < 0:
        return 'No'
    if 4 * A * B < (C-A-B) ** 2:
        return 'Yes'
    return 'No'


def main():
    A, B, C = read_int_n()
    print(slv(A, B, C))


if __name__ == '__main__':
    main()


Measured memory_bytes: 6340
import java.util.*;
class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.nextLine();
		char[] ch = s.toCharArray();

		for(int i=0;i<s.length();i++){
			if('A' <= ch[i] && ch[i] <= 'Z'){
				ch[i] += 32;	
			} else if('a' <= ch[i] && ch[i] <= 'z'){
				ch[i] -= 32;
			}
		}

		System.out.println(ch);
		}
	}


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

#define int long long

using namespace std;

int digSum(string N) 
{ 
    int sum = 0;

    for (int i = 0; i < (int)N.size(); i++) {
        sum += (int)(N[i] - '0');
    }
    return sum; 
} 

int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    //int TT;
    //cin >> TT;
    string N; cin >> N;

    if (digSum(N) % 9 == 0) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    //for (int T = 0; T < TT; T++) {
    //}
    return 0;
}

Measured memory_bytes: 3780
N, C = gets.split.map(&:to_i)
D = (1..C).map { d = gets.split.map(&:to_i) }
CS = (1..N).map { d = gets.split.map(&:to_i) }

def paint(jouyo, new_color)
  iwakan = 0

  i = 0
  j = jouyo
  loop do
    while j>=N
      i += 1
      j = (jouyo-i)%3
      break unless i<N
    end
    break unless i<N

    old_color = CS[i][j]-1
    iwakan += D[old_color][new_color]
    j += 3
  end

  iwakan
end

iwakans = 
  (0...3).map do |i|
    (0...C).map do |c|
      paint(i, c)
    end
  end

cc = (0...C).to_a
res =
  cc.product(cc, cc).map do |c0, c1, c2|
    next if c0==c1 or c1==c2 or c2==c0
    s = iwakans[0][c0] + iwakans[1][c1] + iwakans[2][c2]
  end

puts res.compact.min

Measured memory_bytes: 5756
#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#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++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    vint A(N);
    rep(i, N) cin >> A[i];
    rep(i, N) {
        if (A[i] % 2 == 0) {
            if (A[i] % 3 != 0 && A[i] % 5 != 0) {
                cout << "DENIED" << endl;
                return 0;
            }
        }
    }
    
    cout << "APPROVED" << endl;
    return 0;
}

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

  string s;
  int i;
  
  cin>>s;
  rep(i,s.length())cout<<"x";
  return 0;
}

Measured memory_bytes: 256
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

h, n = na()
ab = []
for i in range(n):
    ab.append(na())

dp = [99999999999999999] * (h+1)
dp[h] = 0
ans = 9999999999999999999
for u in ab:
    for i in range(h, u[0]-1, -1):
        dp[i-u[0]] = min(dp[i-u[0]], dp[i] + u[1])
    for i in range(min(u[0]+1, h+1)):
        ans = min(ans, dp[i] + u[1])
print(ans)


Measured memory_bytes: 42476
#include <bits/stdc++.h>
using namespace std;
int INF = 1e9+7;
using ll = long long;
int main()
{
  string s;
  cin >> s;
  if(s[0] == 'S')
  {
    cout << "Cloudy" << endl;
  }
  else if(s[0] == 'C')
  {
    cout << "Rainy" << endl;
  }
  else if(s[0] == 'R')
  {
    cout << "Sunny" << endl;
  }
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N=2005;
int a[N],mn[N][N];
int now[N];int n,k;
inline int Min(int a,int b){
	return a<b?a:b;
}
inline int qmin(int x,int l){
	if (x-l>0) return mn[x-l][x];
	return Min(mn[1][x],mn[n-(l-x)][n]);
}
int main (){
	scanf ("%d%d",&n,&k);
	for (int i=1;i<=n;i++) scanf ("%d",&a[i]);
	for (int i=1;i<=n;i++)
		for (int j=i;j<=n;j++){
			if (i==j) mn[i][j]=a[i];
			else mn[i][j]=Min(mn[i][j-1],a[j]);
		}
	long long ans=1ll<<60ll;
	for (int i=0;i<n;i++){
		long long now=i*k;
		for (int j=1;j<=n;j++) now+=qmin(j,i);
		ans=min(ans,now);
	}
	printf ("%lld",ans);
	return 0;
}


Measured memory_bytes: 15360
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef map<char,int> mci;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vii;
typedef vector<char> vc;
typedef vector<vc> vcc;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define F first
#define S second
#define in insert
#define mina(a,b) (a)=min((a),(b));
#define maxa(a,b) (a)=max((a),(b));
const int INF = 1e9 + 7;
void solve(){
    int a,b,c; cin>>a>>b>>c;
    cout<<min(c,b/a);
}
int main(){
    int T=1;
    //cin>>T;
    for(int i = 0; i < T; i++) solve(); 
}

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

int main() {
    int sides[3], sum[4] = {0, 0, 0, 0};
    bool isOver = false;
    while(scanf("%d %d %d", &sides[0], &sides[1], &sides[2]) != EOF) {
        sort(sides, sides+3);
        if (sides[0] + sides[1] <= sides[2] ||
            sides[0] + sides[2] <= sides[1] ||
            sides[1] + sides[2] <= sides[0] || isOver)  { isOver = true; continue; };
        sum[0]++;
        sides[0]*= sides[0]; sides[1]*=sides[1]; sides[2]*=sides[2];
        if (sides[0] + sides[1] == sides[2]) sum[1]++;
        else if (sides[0]+sides[1] > sides[2]) sum[2]++;
        else if (sides[0]+sides[1] < sides[2]) sum[3]++;
    }
    printf("%d %d %d %d\n", sum[0], sum[1], sum[2], sum[3]);
    return 0;
}



Measured memory_bytes: 2720
#include <bits/stdc++.h>
using intl = long long;
using itnl = long long;
using itn = int;
using ld = long double;
using namespace std;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define rrep(i, n) for(intl i = (intl)(n) - 1; i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define rrepi(i, a, b) for(intl i = (intl)(a); i > (intl)(b); i--)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,1,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define alength(a) (sizeof(a) / sizeof(a[0]))
#define cin(i, a) rep(i, alength(a))cin >> a[i]
#define ccin(i, j, a) rep(i, alength(a))rep(j, alength(a[i]))cin >> a[i][j]
#define debug(x) cout << #x << ":" << x << endl
#define rdebug(i,x) rep(i, alength(x))cout << #x << "[" << i << "]:" << x[i] << endl
#define sqrt sqrtl
#define itn int
#define double ld
#define pb push_back
#define mp make_pair
#define pii pair<intl,intl>
const intl INF = 1e9;
const intl MOD = 1e9+7;
const ld eps = 1.0e-14;//-9
void fp(bool f){cout << (f ? "Yes" : "No") << endl;}
void fp(bool f, string s, string t){cout << (f ? s : t) << endl;}
intl kai(intl k){
    intl a = 1;
    for(int i = 2; i <= k; i++){
        a *= i;
    }
    return a;
}
intl gcd(intl a, intl b){
    if(!b)return a;
    return gcd(b, a % b);
}
intl lcm(intl a,intl b){
    return a / gcd(a, b) * b;
}
intl digit10(intl a){
    intl b = 0;
    do{
        a /= 10;
        b++;
    }while(a);
    return b;
}
signed main(){
    cout << fixed << setprecision(10);
    intl n,m;
    cin >> n >> m;
    cout << (intl)ceil((double)n / (m * 2 + 1)) << endl;
    return 0;
}

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

class Program
{
    static void Main()
    {
        var sx = NextInt();
        var sy = NextInt();
        var tx = NextInt();
        var ty = NextInt();
        var start = new int[] { 1, 1 };
        var target = new int[] { tx - sx + start[0], ty - sy + start[1] };

        var visited = new bool[tx - sx + 3, ty - sy + 3];
        var now = start;
        var dic = new Dictionary<char, int[]>();
        var ans = "";

        dic['U'] = new int[] { 0, 1 };
        dic['D'] = new int[] { 0, -1 };
        dic['L'] = new int[] { -1, 0 };
        dic['R'] = new int[] { 1, 0 };

        foreach (var turn in Enumerable.Range(0, 4))
        {
            int[] goal;
            if (turn % 2 == 0)
            {
                goal = target;
            }
            else
            {
                goal = start;
            }

            while (now[0] != goal[0] || now[1] != goal[1])
            {
                var cnddt = new List<int>();
                foreach (var k in "UDLR")
                {
                    var nxt = new int[] { now[0] + dic[k][0], now[1] + dic[k][1] };
                    if (nxt[0] < 0 || target[0] + 1 < nxt[0]) { }
                    else if (nxt[1] < 0 || target[1] + 1 < nxt[1]) { }
                    else if ((nxt[0] == goal[0] && nxt[1] == goal[1]) || !visited[nxt[0], nxt[1]])
                    {
                        cnddt.Add((diff(nxt, goal) - diff(now, goal) + 1) * 1000 + k);
                    }
                }
                cnddt.Sort();
                var kk = (char)(cnddt[0] % 1000);
                ans += kk;
                var nxxt = new int[] { now[0] + dic[kk][0], now[1] + dic[kk][1] };
                visited[nxxt[0], nxxt[1]] = true;
                now = nxxt;
            }
        }
        Console.WriteLine(ans);
    }

    static int NextInt()
    {
        return int.Parse(NextString());
    }

    static int diff(int[] a, int[] b)
    {
        return Math.Abs(a[0] - b[0]) + Math.Abs(a[1] - b[1]);
    }

    static string NextString()
    {
        var result = new List<char>();
        while (true)
        {
            int next = Console.Read();
            if (next < 0)
            {
                break;
            }
            var nextChar = (char)next;
            if (!char.IsWhiteSpace(nextChar))
            {
                result.Add(nextChar);
            }
            else if (nextChar != '\r')
            {
                break;
            }
        }
        return string.Join("", result);
    }
}

Measured memory_bytes: 36296
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner cin=new Scanner(System.in);
		
		int n=cin.nextInt(),c=0;List<Integer> A=new ArrayList<>();
		for(int i=0;i<n;i++)A.add(cin.nextInt());
		
		boolean flag=true;
		for(int i=0;i<n-1;i++) {
			int min=i;
			for(int j=i+1;j<n;j++) {
				if(A.get(j)<A.get(min))min=j;
			}
			if(min!=i) {
				Collections.swap(A, i, min);
				c++;
			}
		}
		
		
		for(int i=0;i<n;i++) {
			System.out.print(A.get(i));
			if(i!=n-1)System.out.print(" ");
		}
		System.out.println();
		System.out.println(c);
	}

}



Measured memory_bytes: 26316
#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>


const int mod = 1000000007;

int main() {
	char S[5];
	scanf("%s", S);
	bool bad = false;
	for (int i = 0; i < 3; i++) {
		if (S[i] == S[i + 1]) {
			bad = true;
			break;
		}
	}
	printf("%s", bad ? "Bad" : "Good");
}





Measured memory_bytes: 128
#include <iostream>
using namespace std;
#include <stdio.h>
int main()
{
	int rc[101][101] = { 0 }, r, c;
	cin >> r >> c;
	for (int i = 0; i < r; i++){
		for (int j = 0; j < c; j++){
				cin >> rc[i][j];
				rc[r][j] += rc[i][j];
				rc[i][c] += rc[i][j];
				rc[r][c] += rc[i][j];
		}
	}
	for (int i = 0; i <= r; i++){
		for (int j = 0; j <= c; j++){
			printf("%d",rc[i][j]);
			if (j < c)	printf(" ");
		}
		printf("\n");
	}
}

Measured memory_bytes: 1196