akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
import java.util.Collections;
import java.util.Arrays;


public class Main {
    static final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
		int A = sc.nextInt();
		int B = sc.nextInt();
		System.out.println(Math.max(Math.max(A+B, A-B) , A*B));
    }

    static void sort(int[] a, int b) {//arrays.sort 0で降順, それ以外で昇順
        if (b == 0) {
            Arrays.sort(a);
            int t = 0;
            int c = a.length - 1;
            for (int i = c; i >= c / 2 + 1; i--) {

                t = a[i];
                a[i] = a[c - i];
                a[c - i] = t;
            }
        } else {
            Arrays.sort(a);
        }
    }

    static int SI(String a) {
        return Integer.parseInt(a);
    }

    static char SC(String a) {
        return a.charAt(0);
    }

    static double SD(String a) {
        return new Double(a).doubleValue();
    }

    static String CS(char a) {
        return String.valueOf(a);
    }

    static int DI(double a) {
        return new Double(a).intValue();
    }

    static String DS(double a) {
        return Double.toString(a);
    }

    static int LI(long a) {
        return new Long(a).intValue();
    }

    static char LC(long a) {
        return Long.toString(a).charAt(0);
    }

    static double LD(long a) {
        return new Long(a).doubleValue();
    }

    static long IL(int a) {
        return new Integer(a).longValue();
    }

    static double ID(int a) {
        return new Integer(a).doubleValue();
    }

    static char IC(int a) {
        return Integer.toString(a).charAt(0);
    }

    static String IS(int a) {
        return Integer.toString(a);
    }

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < ( n ); ++i )
using namespace std;
using ll = long long;
using ull = unsigned long long;
using p  = pair<int, int>;
using vec_int = vector<int>;
using vec_str = vector<string>;
#define INF (1<<29)

void debug_input(vec_str& argv)
{
    // デバッグ用引数読み込み
    ifstream file("./input.txt");
    string str;
    while( getline(file, str) ) {
        argv.push_back(str);
    }
}

void debug_split_string(const string& str, vec_str& v)
{
    stringstream ss{str};
    string buf;
    while (getline(ss, buf, ' ')) {
        v.push_back(buf);
    }
}

void debug_split_int(const string& str, vec_int& v)
{
    stringstream ss{str};
    string buf;
    while (getline(ss, buf, ' ')) {
        istringstream ss(buf);
        int temp;
        ss >> temp;
        v.push_back(temp);
    }
}

long long gcd(long long x, long long y) {
  return y ? gcd(y, x % y) : x;
}

int main()
{
#if 0 // for debug
    vec_str argv;
    debug_input(argv);

    // 文字列行の読み込み
    vec_str v;
    debug_split_string(argv[1], v);

    // 数値行の読み込み
    //debug_split_int(argv[0], v);
#endif

//int main()
//{
    int N = 0;
    string S;
#if 1   
	cin >> N;
#endif
#if 0
	cin >> S;
#endif
#if 0
    vec_str v(N);
    //vec_int v(N);
    rep(i, N) cin >> v[i];
#endif

#if 0
    p pp = make_pair(1, 2);
    //cout << pp.first << endl;
    //cout << pp.second << endl;
#endif

    std::ofstream writing_file;
    writing_file.open("output.txt");
    
    ll ans = 0;
    
    int temp = 0;
    for(int i = 1; i <= N; ++i ) {
        
        for( int j = 1; j <= N; ++j ) {
            
            temp = gcd(i, j);
            
            for( int k = 1; k <= N; ++k ) {
                //if( k <= N )
                {
                    //writing_file << i << "," << j << "," << k << "\t";
                    //if(i == 2 && j == 2 && k == 4) {
                        //cout << endl;
                    //}
                    int temp2 = gcd(k, temp);
                    //writing_file << "gcd : " << temp2 << endl;
                    //if( temp2 != 1 ) {
                        //cout << endl;
                    //}
                    //if(i == j && j == k && i == k) 
                        ans += temp2;
                    //else ans += ( temp2 * 3 );
                }
            }
        }
    }
        

    cout << ans << endl;
    
    return 0;
}

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

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

  int cnt = 0;
  for (auto c : s) {
    if (c == 'R')
      ++cnt;
  }

  if (cnt > n / 2)
    puts("Yes");
  else
    puts("No");
}

Measured memory_bytes: 256
// #include<bits/stdc++.h>
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define frep(i, m, n) for(int i = m;i < n;i++)
#define frepr(i, m, n) for(int i = m;i >= n;i--)
#define vsort(v) sort(v.begin(),v.end())
#define ll long long
#define inf 999999999
typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vst;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int main(){
    ll x,y,s;
    while(cin >> x >> y >> s && x*y*s!=0){
        int p;
        int maxi=0;
        for(int i=1;i<s;i++){
            for(int j=1;j<s;j++){
                if(i*(100+x)/100+j*(100+x)/100==s){
                    p=i*(100+y)/100+j*(100+y)/100;
                    // cout << "i:" << i << " j:" << j << " p:" << p << endl;
                    maxi=max(p,maxi);
                }
            }
        }
        cout << maxi << endl;
    }

    return 0;
}


Measured memory_bytes: 3092
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		Map<Integer, ArrayList<Integer>> map = new TreeMap<Integer, ArrayList<Integer>>();
		for(int i = 0; i < M; i++) {
			int P = Integer.parseInt(sc.next());
			int Y = Integer.parseInt(sc.next());
			map.put(Y, new ArrayList<Integer>(Arrays.asList(P, i)));
		}
		
		String ans[] = new String[M];
		int cnt[] = new int[N + 1];
		for(List<Integer> i : map.values()) {
			ans[i.get(1)] = String.format("%06d%06d", i.get(0), ++cnt[i.get(0)]);
		}
		
		for(int i = 0; i < M; i++) {
			System.out.println(ans[i]);
		}
	}
}


Measured memory_bytes: 118456
#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<math.h>
using namespace std; 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define pp(...) "\033[94m [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define dg1(x) debug() << pp(x)
#define dg2(x,y) debug() << pp(x) pp(y)
#define dg3(x,y,z) debug() << pp(x) pp(y) pp(z)
#define dg4(w,x,y,z) debug() << pp(w) pp(x) pp(y) pp(z)
#define msg(x) debug() << x
#define int long long
const int xx = 2e5;
const int MOD = 1e9 + 7;

signed main(){

  ios::sync_with_stdio(false);cin.tie(0);
  string s;
  cin >> s;
  int n = (int) s.size();
  vector<int> a(n + 1 , 0);
  for (int i = 0; i < n; i++) {
    if (s[i] == '<') {
      a[i + 1] = a[i] + 1;//max(a[i + 1], a[i] + 1);
    }
  }
  dg1(a);
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '>') {
      a[i] = max(a[i], a[i + 1] + 1);
    }
  }
  dg1(a);
  long long ans = 0;
  for (int i = 0; i <= n; i++) {
    ans += a[i];
  }
  cout << ans << '\n';
  return 0;
  
}


Measured memory_bytes: 4764
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long a,b,c,k;
	cin>>a>>b>>c>>k;
	if(k<=a)cout<<k<<endl;
	if(k>a&&k<=a+b)cout<<a<<endl;
	if(k>a+b&&k<=a+b+c)cout<<a-k+a+b<<endl;
	if(k>a+b+c)cout<<a-c<<endl;
	return 0;
}

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

using namespace std;

using llong = long long int;

#define rep(i, n) for (int i = 0; i < n; ++i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()

const static int MOD = 1000000007;
const static int INF = 1000000000;
const static int dx[4] = {1, 0, -1, 0};
const static int dy[4] = {0, 1, 0, -1};

int main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, x, t;
    cin >> n >> x >> t;
    cout << int(ceil((double)n/x)*t)<< endl;

    return 0;
}

Measured memory_bytes: 3624
D, G = map(int, input().split())
pclist = [list(map(int, input().split())) for x in range(D)]

n = len(pclist)

cnt = 0
for i in range(2**n):
  total = 0
  tmp = 0
  l = [0]*n
  for j in range(n):
    if (i >> j) & 1:
      total = total + 100*(j+1) * pclist[j][0] + pclist[j][1]
      tmp = tmp + pclist[j][0]
      l[j] = 1
  
  if total >= G:
    if cnt == 0 or cnt > tmp:
      cnt = tmp
  else:
    for k in range(n):
      if l[k] == 1:
        continue
      else:
        for g in range(1, pclist[k][0]):
          addP = 100 * (k+1) * g
          if G - total <= addP:
            if cnt == 0 or cnt > tmp + g:
              cnt = tmp + g
print(cnt)

Measured memory_bytes: 3064
X = int(input())

for A in range(-118, 120):
    Ap = A * A * A * A * A
    for B in range(-119, 119):
        Bp = B * B * B * B * B
        if Ap - Bp == X:
            break
        elif Ap - Bp == -X:
            A, B = B, A
            break
    else:
        continue
    break
print(A, B)


Measured memory_bytes: 9172
import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    from functools import reduce

    n = ni()
    a = na()

    lcm = a[0]
    for i in a:
        lcm = lcm // math.gcd(lcm, i) * i
    lcm %= MOD

    ans = 0
    for ai in a:
        ans += lcm * pow(ai, MOD - 2, MOD) % MOD
        ans %= MOD

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 11712
while True:
    test = [int(score) for score in input().split(" ")]
    m = test[0]
    f = test[1]
    r = test[2]
   
    if m == f == -1:
        break
    elif m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif 65 <= m + f < 80:
        print("B")
    elif 50 <= m + f < 65:
        print("C")
    elif 30 <= m + f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Measured memory_bytes: 7704
using System;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace Atcoder_Answer
{
    class Program
    {
        const Int32 mod = 1000000007;

        static void Main(string[] args)
        {
            string N = ReadLine();

            switch (N[N.Length - 1]) {
                case '2':
                case '4':
                case '5':
                case '7':
                case '9':
                    WriteLine("hon");
                    break;

                case '0':
                case '1':
                case '6':
                case '8':
                    WriteLine("pon");
                    break;

                case '3':
                    WriteLine("bon");
                    break;
            }

            return;
        }

        #region Functions
        public static decimal floor(float d) => Math.Floor((decimal)d);

        public static double nqrt(int n, int value)
        {
            if (n >= 0)
            {
                // 通常のn乗根
                return Math.Pow(n, 1.0 / (double)n);
            }
            else
            {
                if ((n % 2) != 0)
                {
                    // 奇数乗根の場合
                    return -Math.Pow(-n, 1.0 / (double)n);
                }
                else
                {
                    // 偶数乗根の場合
                    return double.NaN;
                }
            }
        }
        #endregion
    }

    public static class Extension
    {
        #region 拡張:bool
        #region キャスト関連
        public static int ToInt(this bool Bool)
        {
            if (Bool) return 1;
            else return 0;
        }

        public static string ToString(this bool Bool, string TrueStr, string FalseStr)
        {
            if (Bool) return TrueStr;
            else return FalseStr;
        }
        #endregion
        #endregion

        #region 拡張:int
        #region キャスト関連
        public static char ToAlphaBets(this int Base) => (char)Base;
        #endregion
        #endregion

        #region 拡張:char
        #region 変換関連
        public static char NextAlpha(this char Char) => (char)((Char) + 1); //次の文字を取得
        #endregion
        #endregion

        #region 拡張:int[]
        public static long Sum(this int[] Array)
        {
            int Ret = 0;
            for (int loop = 0; loop < Array.Length; loop++) Ret += Array[loop];
            return Ret;
        }
        #endregion

        #region 拡張: string
        public static string Multi(this string THIS, int Value)
        {
            string RetValue = "";

            for (int loop = 0; loop < Value; loop++) RetValue += THIS;

            return RetValue;
        }
        #endregion

        #region 拡張: List<string>
        public static string Sum(this List<string> THIS, string Split)
        {
            string RetValue = "";

            for (int loop = 0; loop < THIS.Count; loop++)
            {
                RetValue += THIS[loop];
            }

            return RetValue;
        }
        #endregion
    }
}


Measured memory_bytes: 17352
#include<cstdio>
int n,m,ans,is;
int prt[100001];
int belong[100001],cnt;
inline int read() {
	int ln=0;
	char ch=getchar();
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') {
		ln=ln*10+ch-'0';
		ch=getchar();
	}
	return ln;
}
inline int find(int x) {
	if(prt[x]==x) return x;
	return prt[x]=find(prt[x]);
}
inline void init() {
	n=read(),m=read();
	for(int i=1;i<=n;i++) prt[i]=i;
	for(int i=1,u,v,w;i<=m;i++) {
		u=read(),v=read(),w=read();
		u=find(u);
		v=find(v);
		if(u!=v) prt[u]=v;
	}
}
inline int find2(int x) {
	if(belong[x]) {
		is=1;
		return belong[x];
	}
	if(prt[x]==x) {
		belong[x]=++cnt;
		return cnt;
	}
	return belong[x]=find2(prt[x]);
}
inline void solve() {
	for(int i=1;i<=n;i++) {
		if(belong[i]==0) {
			is=0;
			find2(i);
			if(is==0) ans++;
		}
	}
	printf("%d",ans);
}
int main() {
	init();
	solve();
	return 0;
}

Measured memory_bytes: 3220
require 'set'

class Line
	#ax+by = c   (a > 0 or (a == 0 && b > 0))
	def self.through_two_points(x1, y1, x2, y2)
		a = y1 - y2
		b = x2 - x1
		c = a * x1 + b * y1
		new(a, b, c, x1, y1, x2, y2)
	end

	def overlap?(l)
		if @a == 0
			return false unless l.a == 0
			return false unless l.b * @c == @b * l.c
		else
			return false unless l.a * @b == @a * l.b && l.a * @c == @a * l.c
		end
		if @a == 0
			return true if @x1 < l.x1 && l.x1 < @x2
			return true if @x1 < l.x2 && l.x2 < @x2
			return true if l.x1 <= @x1 && @x2 <= l.x2
			return true if @x1 < l.x1 && l.x2 < @x2
		else
			return true if @y1 < l.y1 && l.y1 < @y2
			return true if @y1 < l.y2 && l.y2 < @y2
			return true if l.y1 <= @y1 && @y2 <= l.y2
			return true if @y1 <= l.y1 && l.y2 <= @y2
		end
		false
	end

	private_class_method :new

	def initialize(*args)
		@a, @b, @c, @x1, @y1, @x2, @y2 = args	
		@x1, @y1, @x2, @y2 = @x2, @y2, @x1, @y1 if @y1 > @y2
		@x1, @y1, @x2, @y2 = @x2, @y2, @x1, @y1 if @x1 > @x2
		if @a < 0
			@a *= -1
			@b *= -1
			@c *= -1
		elsif @a == 0 && @b < 0
			@b *= -1
			@c *= -1
		end
	end

	attr_reader :a, :b, :c, :x1, :y1, :x2, :y2
end

def f(graph, color)
	return color.values.max if color.size == graph.size
	i = color.size
	candidates = (1..color.values.max+1).to_a - graph[i].map{|j| color[j]}
	min = Float::INFINITY
	candidates.each do |c|
		new_color = color.dup
		new_color[i] = c
		x = f(graph, new_color)
		min = x if x < min
	end
	min
end

loop do
	n = gets.to_i
	break if n == 0
	territory = []
	country = {}
	name_to_idx = {}
	n.times do
		name = gets.chomp
		c = (name_to_idx[name] ||= name_to_idx.size)
		pos = []
		loop do
			x, y = gets.split.map(&:to_i)
			break if x == -1
			pos << [x, y]
		end
		pos << pos[0]
		lines = pos.each_cons(2).map do |p1, p2|
			Line::through_two_points(*p1, *p2)
		end
		country[territory.size] = c
		territory << lines
	end

	t_edges = []
	(0..territory.size-1).to_a.combination(2) do |i, j|
		t1, t2 = territory[i], territory[j]
		if t1.product(t2).any?{|l1, l2| l1.overlap?(l2)}
			t_edges << [i, j]
		end
	end
	
	graph = {}
	(0..name_to_idx.size-1).each {|i| graph[i] = Set.new}
	t_edges.each do |i, j|
		u = country[i]
		v = country[j]
		next if u == v
		graph[u] << v
		graph[v] << u
	end

	p f(graph, {0 => 1})
end

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

namespace ConsoleApp6
{
    class Program
    {

        static void Main(string[] args)
        {
            int[] a = new int[5];
            int dup = 0;
            int sum = 0;

            for (int i = 0; i < 5; ++i)
            {
                a[i] = int.Parse(Console.ReadLine());//読み込み
            }
            int min = 10;//比較対象
            int o = 0;//配列番号



            for (int j = 0; j < 5; ++j)
            {
                int k = a[j] % 10;
                if (min > k && k != 0)
                {
                    min = k;
                    o = j;
                }
                if (k == 0)
                {
                    dup++;
                }
            }
            /*
            for (int l = 0; l < 5; ++l)
            {
                if (o != l)
                {
                    a[l] = a[l] - a[l] % 10;
                }

            }
            */
            for (int l = 0; l < 5; ++l)
            {
               
                    a[l] = a[l] - a[l] % 10;
             
            }
            for (int m = 0; m < 5; ++m)
            {

                sum = sum + a[m];

            }

            sum = sum + 10 * (4 - dup)+min;

            Console.WriteLine(sum);




            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#define INF 0x7fffffff
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<ld> vld;

#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()

int main()
{
	fastIO;
	const int mod = 1e9 + 7;
	int n; cin >> n;
	ll ans = 0, sum = 0;
	vll a(n);
	for(int i = 0; i < n; i++) 
	{
		cin >> a[i]; 
		if(i > 0) ans += sum*a[i] % mod, ans %= mod;
		sum += a[i]; sum %= mod;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4788
S = input()
S_list = list(set(S))
al = 'abcdefghijklmnopqrstucwxyz'
al_list = list(al)
S_list.sort()
flg = 1
for i in range(len(al_list)):
    if al_list[i] in S_list:
        pass
    else:
        print(al_list[i])
        flg = 0
        break
    
if flg == 1:
    print('None')

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

typedef long long LL;

int main () {
  LL A, B, K;
  cin >> A >> B >> K;
  LL t = min(K, A);
  K -= t;
  A -= t;
  t = min(K, B);
  K -= t;
  B -= t;
  cout << A << " " << B << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <cmath>
#define ll long long
#define LINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f
#define PI 3.14159265
using namespace std;
const int MAX = 1e5 + 10;
const ll MOD = 1e9 + 7;
int N, M, K, Q;
int cnt[5];

int main()
{
	int i, j, k;
	int a, b;
	for (i = 0; i < 3; ++i) {
		scanf("%d%d", &a, &b);
		cnt[a]++;
		cnt[b]++;
	}
	for (i = 1; i <= 4; ++i) {
		if (cnt[i] >= 3){
			printf("NO");
			return 0;
		}
	}
	printf("YES");
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cassert>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
#include <iomanip>
#include <fstream>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define chmax(a,b) (a<b?(a=b,1):0)
#define chmin(a,b) (a>b?(a=b,1):0)
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
const int INF = 1<<29;
typedef long long ll;
typedef pair<int,int> pii;

string P[10];
string Q[10];
int p,q;

int pr[11],pc[11],ps[11];
int indent[11];
int qr[11],qc[11],qs[11];

bool check(int R, int C, int S) {
  REP(i,p) {
    if (indent[i] != R*pr[i] + C*pc[i] + S*ps[i]) return 0;
  }
  return 1;
}

void solve() {
  set<int> st[q];
  for (int R=1; R<=20; ++R) {
    for (int C=1; C<=20; ++C) {
      for (int S=1; S<=20; ++S) {
        if (check(R,C,S)) {
          REP(i,q) {
            st[i].insert(qr[i]*R + qc[i]*C + qs[i]*S);
          }
        }
      }
    }
  }
  REP(i,q) {
    if (i) cout << " ";
    if (st[i].size() == 1) {
      cout << *st[i].begin();
    } else {
      cout << -1;
    }
  }
  cout << endl;
}

int main() {
  while(cin>>p>>q,p||q) {
    REP(i,p) cin >> P[i];
    REP(i,q) cin >> Q[i];

    {
      int r=0,c=0,s=0;      
      REP(i,p) {
        FOR(it, P[i]) {
          if (*it=='(') r++;
          else if (*it==')') r--;
          else if (*it=='{') c++;
          else if (*it=='}') c--;
          else if (*it=='[') s++;
          else if (*it==']') s--;
        }
        int id = 0;
        while(id<P[i].size() && P[i][id]=='.') id++;
        indent[i] = id;
        pr[i+1] = r, pc[i+1] = c, ps[i+1] = s;
        // cout << r << " " << c << " " << s << endl;
      }
    }
    {
      int r=0,c=0,s=0;
      REP(i,q) {
        FOR(it, Q[i]) {
          if (*it=='(') r++;
          else if (*it==')') r--;
          else if (*it=='{') c++;
          else if (*it=='}') c--;
          else if (*it=='[') s++;
          else if (*it==']') s--;
        }
        qr[i+1] = r;
        qc[i+1] = c;
        qs[i+1] = s;
      }
    }
    
    solve();
  }
}

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

using namespace std;

string f(const string &s, const string &t)
{
    // cout << s << ' ' << t << endl;
    int s1 = s.size(), s2 = t.size();
    for (int i = 0; i < min(s1, s2); ++i) {
        if (s[i] != t[i]) {
            if (s[i] < t[i]) return s;
            else return t;
        }
    }
    if (s1 < s2) return s;
    return t;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    string s = string(b, a+'0'), t = string(a, b+'0');
    cout << f(s, t) << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int a, b, c, cnt = 0, x;
		Scanner sc = new Scanner(System.in);
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		for(x = a; x <= b; x++){
			if(c % x == 0)
				cnt++;
			else if(c / x >= 0)
				a = b;
		}
		System.out.println(cnt);
	}
}

Measured memory_bytes: 26136
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int K = scn.nextInt();
		int[] H = new int[N];
		for(int i = 0;i < N;i++) {
			H[i] = scn.nextInt();
		}
		Arrays.sort(H);
		int ans = Integer.MAX_VALUE;
		for(int i = 0;i < N-K+1;i++) {
			ans = Math.min(ans, H[K-1+i] - H[i]);
		}
		System.out.println(ans);

	}
}


Measured memory_bytes: 49772
#include<iostream>
using namespace std;
int main()
{
  int n;cin>>n;
  int D[n][2];
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<2;j++)
    {cin>>D[i][j];}
  }
  int a=0;
  for(int i=0;i<n-2;i++)
  {if(D[i][0]==D[i][1] && D[i+1][0]==D[i+1][1] && D[i+2][0]==D[i+2][1])
    a++;
  }
  if(a==0)
    cout<<"No";
  else
    cout<<"Yes";
  return 0;
}
 

Measured memory_bytes: 3632
d[150][120];b,i,j,s,t,m,n,*p;main(a){for(;scanf("%d%d",&n,&m)*n;printf("%d\n",s)){for(memset(d,9,7e4);t=m--;d[a][b]=d[b][a]=i/100)scanf("%d,%d,%d",&a,&b,&i);for(s=i=1-n;i++;s+=d[n][t=m])for(d[j=m=n][t]=0;j--;*p&&d[n][m]>*p?m=j:0)p=d[n]+j,*p=fmin(*p,d[t][j]);}}

Measured memory_bytes: 0
#include <stdio.h>

void syori1(double a,double b,double c,double d,double e,double f,double *x,double *y){		/*x + y= (ªÓ½Â) Ìûö®ðð­B*/
	*x=( c*(e/b)-f )/( a*(e/b)-d ) + 0.0;
	*y=( (c-a*(*x))/b ) + 0.0;
}

int syori2(double n){	/*	¬_æ4ÊðlÌÜü	yg¢ûzn+=syori2(n) */
	n*=1000;
	n = n - (double)(int)n;
	if(n>=0.5){
		return (0.001);
	}else{
		return 0;
	}
}

int main(){
	double	a,b,c,d,e,f,
			x,y;
	
	while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
		syori1(a,b,c,d,e,f,&x,&y);
		
		x+=syori2(x);
		y+=syori2(y);
		
		printf("%.3lf %.3lf\n",x,y);
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int x, y, z;
        cin >> x >> y >> z;
        if(x == 0)
            return 0;

        vector<int> roulette(x);
        for(int i=0; i<x; ++i)
            cin >> roulette[i];

        vector<pair<int, int> > masu(y+1, make_pair(-1, -1));
        for(int i=0; i<z; ++i){
            int n, e, a;
            cin >> n >> e >> a;
            masu[n] = make_pair(e, a);
        }

        vector<vector<double> > prob(y+1, vector<double>(y*100+1, 0.0));
        prob[0][0] = 1.0;
        for(int i=0; i<y; ++i){
            for(int j=0; j<x; ++j){
                int to = min(y, i + roulette[j]);
                int get = 0;
                if(masu[to].first == 1)
                    to = min(y, to + masu[to].second);
                else if(masu[to].first == 2)
                    get = masu[to].second;
                else if(masu[to].first == 3)
                    get = -masu[to].second;
                for(int k=0; k<=i*100; ++k){
                    int money = max(0, k+get);
                    prob[to][money] += prob[i][k] / x;
                }
            }
        }

        double ret = 0.0;
        for(int i=0; i<=y*100; ++i)
            ret += i * prob[y][i];
        cout << (int)ret << endl;
    }
}

Measured memory_bytes: 2944
#include<stdio.h>
int main(){
  char s[100010];
  int i,j,k,l,M=1e9+7,d[100010][15]={1};
  scanf("%s",s);
  /*if('0'<=s[0]&&s[0]<='9')d[1][s[0]-'0']=1;
  else{
    for(i=0;i<10;i++)d[1][i]=1;
    }//*/
  for(i=0;s[i];i++){
    for(j=0;j<13;j++){
      if('0'<=s[i]&&s[i]<='9'){
	l=(j*10+s[i]-'0')%13;
	d[i+1][l]=(d[i+1][l]+d[i][j])%M;
      }
      else{
	for(k=0;k<10;k++){
	  l=(j*10+k)%13;
	  d[i+1][l]=(d[i+1][l]+d[i][j])%M;
	}
      }
    }
  }
  printf("%d\n",d[i][5]);
  return 0;
}


Measured memory_bytes: 6144
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
#define inf 1e18+42
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971693993751058
#define maxn 100005

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define fori(it,A) for(auto it=A.begin();it!=A.end();it++)

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define all(x) (x).begin(),(x).end()
#define zero(x) memset(x,0,sizeof(x));
#define ceil(a,b) (a+b-1)/b
 
using namespace std;

int binpow(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

//START OF CODE ->->->->->->->

void solve()
{
    int n,k;
    cin>>n>>k;
    vector< pair<int,int> > p;
    if ( k > (n-1)*(n-2)/2 ){
        cout<<"-1"<<endl;
    }
    else{
        rep(i,0,n-1){
            p.pb(mp(1,i+2));
        }
        int x =  - k + (n-1)*(n-2)/2;
        int l = 2;
        int r = 3;
        rep(i,0,x){
            p.pb(mp(l,r));
            if ( r == n ){
                l++;
                r = l+1;
            }
            else{
                r++;
            }
        }

        cout<<p.size()<<endl;
        rep(i,0,p.size()){
            cout<<p[i].ft<<" "<<p[i].sd<<endl;
        }
    }
}

//END OF CODE ->->->->->->->->

signed main()
{
    fast;
    int t = 1;
    // cin>>t;

    while(t--)
    {
        solve();
    }
    return 0;
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
# define M_PI 3.14159265358979323846
using ll = long long int;
const int MOD = 1e9 + 7;
int main()
{
    int n;
    cin>>n;
    ll sum=0;
    for (int i = 1; i < n+1; i++)
    {
        if(i%3!=0 && i%5!=0)
        {
            sum+=i;
        }
    }
    cout<<sum;
}

Measured memory_bytes: 3600
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

p = 1000000007
n,m = na()

dp = [1]*(n+1)

for i in range(m):
    a = ni()
    dp[a] = 0

for i in range(2,n+1):
    if dp[i] == 0:
        continue
    dp[i] = (dp[i-1] + dp[i-2])%p

print(dp[-1])

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

int main() {
	int n,j;
	cin>>n;
	double arr[n]={0};
	int i;
	for(i=0;i<n;i++)
	{
	    cin>>arr[i];
	}
	double dp[n+1][n+1]={0};
	dp[0][0]=1.00000000;
	for(i=1;i<n+1;i++)
	{
	    dp[i][i]=dp[i-1][i-1]*arr[i-1];
	    dp[0][i]=dp[0][i-1]*(1-arr[i-1]);
	}
	
	for(i=1;i<n+1;i++)
	for(j=i+1;j<n+1;j++)
	dp[i][j]=dp[i-1][j-1]*(arr[j-1])+dp[i][j-1]*(1-arr[j-1]);
	double ans=0;
	for(i=(n/2)+1;i<n+1;i++)
	ans+=dp[i][n];
	
	cout << fixed << setprecision(10)<<ans<<endl; 
	return 0;
	
}


Measured memory_bytes: 70528
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    int n; cin>>n;
    vector<int> p(n), q(n);
    rep(i,n) cin>>p[i];
    rep(i,n) cin>>q[i];
    vector<int> sp(n), sq(n);
    sp[0]=p[0]; sq[0]=q[0];
    rep(i,n-1){
        sp[i+1]=sp[i]+p[i+1];
        sq[i+1]=sq[i]+q[i+1];
    }
    int ans=sq[n-1]+sp[0];
    for(int i=1; i<n; ++i){
        int kari=sp[i]+sq[n-1]-sq[i-1];
        ans=max(ans,kari);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3632
# define _CRT_SECUREj_NO_WARNINGS 1
# define _USE_MATH_DEFINES
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <forward_list>
# include <map>
# include <stack>
using namespace std;
# define INF ((int)(1<<25))
# define REP(i,n) for(int i=0;i<(int)n;i++)
# define FOR(i,n) REP(i,n)
# define TORAD 2.0*M_PI/360.0
# define INT(x) int x;cin>>x;
# define ALL(x) (x).begin(),(x).end()
# define RALL(x) (x).rbegin(),(x).rend()
# define DEBUG(x) cout<<#x<<" :"<<x<<endl;
# define EPS 1e-12
template<class T> void debug(T a) { for (auto iiiiiiiiii : a)cout << iiiiiiiiii << endl; }
typedef vector<int> vi;
typedef vector<string> vs;
#define int long long
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };

const int MAX_N = 1<<18;
int n;
pii dat[2 * MAX_N - 1];

void init(int n_)
{
	n = 1;
	while (n < n_)n *= 2;
	for (int i = 0; i < 2 * n - 1; i++)dat[i] = pii(INT_MAX,0);
}

void update(int k, pii a)
{
	k += n - 1;
	dat[k] = a;
	while (k > 0)
	{
		k = (k - 1) / 2;
		dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
	}
}

pii query(int a, int b, int k, int l, int r)
{
	if (r <= a || b <= l)return pii(INT_MAX,0);
	if (a <= l&&r <= b)return dat[k];
	else
	{
		pii vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
		pii vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
		return min(vl, vr);
	}
}

pii calc(int a, int b)//[a,b)
{
	return query(a, b, 0, 0, n);
}
int ans[200000] = {};
signed main()
{
	int r, l;
	cin >> n >> r >> l;
	
	init(n);
	for (int i = 0; i < n; i++)update(i, pii(0,i));
	int b = 0;
	while (r--)
	{
		int d, t, x;
		cin >> d >> t >> x; d--;
		ans[calc(0, n).second] += t-b;
		b = t;
		pii p = dat[d+ n - 1];
		p.first -= x;
		update(d , p);
	}ans[calc(0, n).second] += l - b;
	int p = -1, id = 0;
	for (int i = n-1; i >= 0; i--)
	{
		if (ans[i] >= p)
		{
			p = ans[i];
			id = i + 1;
		}
	}


	cout << id << endl;
}

Measured memory_bytes: 7896
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<map>
#include<unordered_map>
#include<queue>
#include<deque>

using namespace std;
using ll=long long;
#define rep(i,n)  for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()

vector<vector<int>> g(10);

bool istrue(int pos, vector<int> path){
    bool out = false;
    rep(i, g[pos].size())if(g[pos][i]==path.front())out = true;
    
    int next = path.front();
    path.erase(path.begin());

    if(!out)return false;
    else {
        if(path.empty())return true;
        else return istrue(next, path);
    }
}

int main(){
    int n, m;
    cin >> n >> m;

    rep(i, m){
        int a, b;
        cin >> a >> b;
        a--, b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }

    vector<int> arr(n-1);
    rep(i, n-1)arr[i] = i+1;

    ll ans = 0;
    do{
        if(istrue(0, arr))ans++;
    }while(next_permutation(ALL(arr)));

    cout << ans << endl;
}

Measured memory_bytes: 256
#!/usr/bin/ruby
n=gets.to_i
s=gets.chomp
[83,87].repeated_permutation(2).find{|_|
	a=_.dup
	2.upto(n+1){|i|
		a[i]=a[i-2]^((a[i-1]==87)^(s[~-i%n]==?x) ? 4 : 0)
	}
	$><<a[0..-3].map(&:chr)*''if a[0]==a[n]&&a[1]==a[n+1]
}||(p -1)

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

int cmp(long long A,long long B){
    if(A==B)return 3;
    if(A!=1&&B!=1){
        if(A>B)return 1;
        if(A<B)return 2;
    }

    if(A==1)return 1;
    if(B==1)return 2;
}
int main() {
    long long a,b;
    cin>>a>>b;
    if(cmp(a,b)==1)cout<<"Alice"<<endl;
    else if(cmp(a,b)==2)cout<<"Bob"<<endl;
    else cout<<"Draw"<<endl;
}


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

int main()
{
  int n;
  cin >> n;
  int a,b;
  vector<pair<int, int>> task;
  REP(i,n){
    cin >> a >> b;
    task.push_back(make_pair(b,a));
  }
  sort(ALL(task));
  int time=0;
  for(auto t: task){
    time += t.second;
    if(time>t.first){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

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

int main(){
  int n, sum=0;
  cin >> n;
  
  for(int i = n; i > 0; i /= 10){
    sum += i % 10;
  }
  
  if((n % sum) == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3584
/*
    STARK_BOY
*/
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repe(i,a,b) for(ll i=a;i<=b;i++)
#define bac(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef long long ll;
typedef vector< ll > vi;
typedef vector<pair<ll,ll> > vpii;
typedef pair<ll,ll> pii;
#define all(c) c.begin(),c.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define setbitc(x) __builtin_popcount(x)
#define init(x,a) memset(x,a,sizeof(x))
#define PI           3.14159265358979323846  /* pi */
mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
#define N 1000005
//Variables Start
ll inf=1e18,MOD=1e9+7;
ll n,m,k,ar[N],br[N];
string s,s1;
//Variables End
bool ispali(string s1)
{
	string t=s1;
	reverse(all(t));
	rep(i,0,s1.length())
	{
		if(t[i]!=s1[i])return false;
	}
	return true;

}
int main()
{
    ios
    int ti=1;
    //cin>>ti;
    while(ti--)
    {
		cin>>s;
		n=s.length();
		string s1=s.substr(0,n/2);
		bool ok=true;
		if(ispali(s1))
		{
			rep(i,0,s1.length())
			{
				if(s[n-1-i]!=s1[i])
				{
					ok=false;
					break;
				}
			}
		}
		else ok=false;

		if(ok)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;


    }
    return 0;
        
}

Measured memory_bytes: 256
n, res = map(int, input().split())
for x in range(n + 1):
    for y in range(n - x + 1):
        z = n - x - y
        if res == 10000 * x + 5000 * y + 1000 * z:
            print(x, y, z)
            exit()
print("-1 -1 -1")

Measured memory_bytes: 9120
#include <iostream>
#include <algorithm>
#include <math.h>
#include <stack>

using namespace std;

int main(void) {
	int L, tmp;
	bool c[100];//猫が穴に入っているかのフラグ
	for (int i = 0; i < 100; i++) c[i] = false;
	stack<int> stack;

	cin >> L;
	for (int i = 0; i < L; i++) {
		cin >> tmp;
		if (tmp > 0) {
			if (!c[abs(tmp)]) {
				c[abs(tmp)] = true;//反転
				stack.push(abs(tmp));
			}
			else {
				std::cout << (i + 1) << endl;
				return 0;
			}
		}
		else {
			if ((stack.size()==0) || (stack.top() != abs(tmp))){
				std::cout << i + 1 << endl;
				return 0;
			}
			else { stack.pop(); c[abs(tmp)] = false; }
		}
	}
	std::cout << "OK" << endl;

	return 0;
}


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

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

	for (int i = a; i <= b; ++i) {
		if (i % k == 0) {
			cout << "OK" << endl;
			return 0;
		}
	}

	cout << "NG" << endl;

	return 0;
}

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

using namespace std;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
typedef long long ll;
typedef pair<int, int> pi;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;

const int MAX_N = 4e2 + 10, MOD = 1e9 + 7;

int N, C, A[MAX_N], B[MAX_N], P[MAX_N][MAX_N], Sum[MAX_N][MAX_N];
int Dy[MAX_N][MAX_N];
int getSum(int a, int b, int p) {
	return (Sum[b][p] - Sum[a-1][p] + MOD) % MOD;
}
int main() {
	for(int i=1; i<MAX_N; i++) {
		P[i][0] = 1;
		for(int j=1; j<MAX_N; j++) P[i][j] = 1ll * P[i][j-1] * i % MOD;
	}
	for(int j=0; j<MAX_N; j++) for(int i=1; i<MAX_N; i++) Sum[i][j] = (Sum[i-1][j] + P[i][j]) % MOD;

	cin >> N >> C;
	for(int i=1; i<=N; i++) scanf("%d", &A[i]);
	for(int i=1; i<=N; i++) scanf("%d", &B[i]);
	Dy[0][0] = 1;
	for(int i=1; i<=N; i++) for(int j=0; j<=C; j++) {
		for(int k=0; k<=j; k++) {
			int plus = 1ll * getSum(A[i], B[i], j-k) * Dy[i-1][k] % MOD; 
			Dy[i][j] = (Dy[i][j] + plus) % MOD;
		}
	}
	printf("%d\n", Dy[N][C]);
	return 0;
}


Measured memory_bytes: 2176
package main

import (
	"fmt"
	"math"
)

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)

	if a*c <= b {
		fmt.Println(c)
	} else {
		fmt.Println(math.Floor(float64(b / a)))
	}
}


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

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

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  
  string s;
  while (cin >> s, s != "#") {
    int sz = s.size();
    vector<vector<int>> dp(sz, vector<int>(2, 0));
    for (int i = 0; i < sz - 1; i++) {
      int now = (s[i] - '1') % 3, next = (s[i + 1] - '1') % 3;
      dp[i + 1][0] = dp[i][0] + 1;
      dp[i + 1][1] = dp[i][1] + 1;
      if (next <= now) dp[i + 1][0] = min(dp[i + 1][0], dp[i][1]);
      if (next >= now) dp[i + 1][1] = min(dp[i + 1][1], dp[i][0]);
    }
    cout << min(dp[sz - 1][0], dp[sz - 1][1]) << endl;
  }

  return 0;
}


Measured memory_bytes: 8552
#include <stdio.h>

int main()
{
    int S,h,m,s;
    
    scanf("%d\n",&S);
    
    h=S/3600;
    m=S%3600/60;
    s=S%60;
    
    printf("%d:%d:%d\n",h,m,s);

    return 0;
}


Measured memory_bytes: 1932
#  --*-coding:utf-8-*--

def f(n, vals):
    return 3**n - 2**(sum(x%2==0 for x in vals))
    

def test():
    assert f(2, [2, 3]) == 7
    assert f(3, [3, 3, 3]) == 26
    assert f(10, [90, 52, 56, 71, 44, 8, 13, 30, 57, 84]) == 58921

def main():
    n = int(input())
    vals = map(int, input().split())
    
    print(f(n, vals))
    

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 100000000;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main() {
    ll n, cnt;
    cin >> n;
    vector<ll> a(n);
    rep1(i, n) cin >> a[i];
    ll ans = 0;
    sort(a.begin(), a.end());
    for (ll i=0; i<(n); i++){
        for (ll j=i+1; j<(n); j++){
            for (ll k=j+1; k<(n); k++){
                if (a[i]==a[j] || a[j]==a[k]) continue;
                if (a[i]+a[j]>a[k] && a[i]+a[k]>a[j] && a[k]+a[j]>a[i]) ans++;
            }
        }
    }
    cout << ans << endl;
    //printf("%.12f", ans);
}

Measured memory_bytes: 3628
#include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<time.h>
#include<ctime>
#include<functional>
#define int long long
#define INT INT_MAX
#define LONG LLONG_MAX
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
typedef long long ll;
using namespace std;

signed main() {
	int n, a[300000], b = 0;
	cin >> n;
	f(i, n * 3) cin >> a[i];
	sort(a, a + n * 3);
	f(i, n) b += a[n * 3 - i * 2 - 2];
	cout << b << endl;
	return 0;
}

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

// iterator
#define REP(i,init, n) for(lli i=init;i<n;i++)
#define REPE(i,init, n) for(lli i=init;i<=n;i++)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

// input
#define cin1(x)             cin >> x
#define cin2(x, y)          cin >> x >> y
#define cin3(x, y, z)       cin >> x >> y >> z
#define ncin1(n, x)         REP(i, 0, n) {cin1(x[i]);}
#define ncin2(n, x, y)      REP(i, 0, n) {cin2(x[i], y[i]);}
#define ncin3(n, x, y, z)   REP(i, 0, n) {cin3(x[i], y[i], z[i]);}

// output
#define cout1(x)         cout << #x << ": " << x << endl;
#define cout2(x, y)      cout << #x << ": " << x << ", " << #y << ": " << y << endl;
#define cout3(x, y, z)   cout << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;;
#define ncout1(n, x)     REP(i, 0, n) {cout << #x << "[" << i << "]: "<< x[i] << endl;}

// sort
#define sort_r(x, y)        sort(x, y, greater<lli>()); // 降順(5,4,3,,,)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;
typedef tuple<lli, lli, lli> tup;

int main() {
    lli n;
    cin1(n);
    lli h[n];
    ncin1(n, h);

    lli ans = 0;
    lli count = 0;
    REP(i, 1, n) {
        if (h[i] <= h[i-1]) {
            count++;
        }
        else {
            ans = max(ans, count);
            count = 0;
        }
    }
    cout << max(ans, count) << endl;
}


Measured memory_bytes: 1024
#include <stdio.h>

int main(void)
{
 int n, i, j, r, t, y, u;
 int a[4][11], b[4][11], c[4][11], d[4][11];

for(i = 0; i <= 3; i++){
 for(j = 0; j <= 10; j++){
a[i][j] = 0;
b[i][j] = 0;
c[i][j] = 0;
d[i][j] = 0;
}
}

scanf("%d", &n);

for(i = 0; i < n; i++)
{
 scanf("%d %d %d %d", &r, &t, &y, &u);

if(r == 1)
a[t][y] += u;

if(r == 2)
b[t][y] += u;

if(r == 3)
c[t][y] += u;

if(r == 4)
d[t][y] += u;

}

for(i = 1; i <= 3; i++){
 for(j = 1; j <= 10; j++){

printf(" %d", a[i][j]);

}
printf("\n");
}

printf("####################\n");

for(i = 1; i <= 3; i++){
 for(j = 1; j <= 10; j++){

printf(" %d", b[i][j]);

}
printf("\n");
}

printf("####################\n");

for(i = 1; i <= 3; i++){
 for(j = 1; j <= 10; j++){

printf(" %d", c[i][j]);

}
printf("\n");
}

printf("####################\n");

for(i = 1; i <= 3; i++){
 for(j = 1; j <= 10; j++){

printf(" %d", d[i][j]);

}
printf("\n");
}


return 0;
}



Measured memory_bytes: 2020