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

public class Main {
	static final PrintStream out = System.out;
	static final Scanner sc = new Scanner(System.in);
	static final long Mod = 1000_000_007L;
	int N;

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
		System.exit(0);
	}

	void solve() {
		N = nextInt();
		int [][]XL = new int[N][2];
		for(int i=0;i<N;i++) {
			XL[i][0] = nextInt();
			XL[i][1] = nextInt();
		}
		Arrays.sort(XL,(a1,a2)->MyComparator(a1[0],a2[0],a1[1],a2[1]));

		int before_i = 0;
		int rmCnt = 0;

		for(int i=1;i<N;i++) {
			if(XL[before_i][0]+XL[before_i][1]<=XL[i][0]-XL[i][1]) {
				before_i = i;
			}else
			if(XL[before_i][0]+XL[before_i][1]>=XL[i][0]+XL[i][1]) {
				before_i = i;
				rmCnt++;
			}else {
				rmCnt++;
			}
		}
		out.println(N-rmCnt);
	}

	private int MyComparator(int a1, int a2,int b1,int b2) {
		if(a1 > a2) return 1;
		else if(a1 < a2) return -1;
		if(b1 > b2) return 1;
		else if(b1 < b2) return -1;
		return 0;
	}


	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)a[i] = nextInt();
		return a;
	}
	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)a[i] = nextLong();
		return a;
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String next() {
		return sc.next();
	}

	long gcd(long m,long n) {
		if (m<n) return gcd(n,m);
		if (n==0)return m;
		return gcd(n,m%n);
	}

	long lcm(long m, long n) {
	        return m * n / gcd(m, n);
	}
}

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

int main() {
	int n;
	cin >> n;
	int a, ma = 0, mi = 1000;
	while (cin >> a) {
		ma = max(ma, a);
		mi = min(mi, a);
	}
	cout << ma - mi << endl;
}

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

int A[53] , B[53] , N; long long ans; bool vis[53] , use[53];

int main(){
	cin >> N;
	for(int i = 1 ; i <= N ; ++i) cin >> A[i];
	for(int i = 1 ; i <= N ; ++i) cin >> B[i];
	for(int i = 50 ; i ; --i){
		bool flg = 0;
		for(int j = 1 ; j <= N ; ++j){
			memset(vis , 0 , sizeof(vis)); vis[A[j]] = 1;
			for(int k = 50 ; k ; --k)
				if(use[k] || k < i)
					for(int l = 1 ; l <= 50 ; ++l)
						vis[l % k] |= vis[l];
			flg |= !vis[B[j]];
		}
		if(flg){ans += 1ll << i; use[i] = 1;}
	}
	for(int i = 1 ; i <= N ; ++i){
		memset(vis , 0 , sizeof(vis)); vis[A[i]] = 1;
		for(int k = 50 ; k ; --k)
			if(use[k])
				for(int l = 1 ; l <= 50 ; ++l)
					vis[l % k] |= vis[l];
		if(!vis[B[i]]){puts("-1"); return 0;}
	}
	cout << ans; return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin>>n;
  vector<vector<ll>>a(n,vector<ll>(n));
  rep(i,n)rep(j,n)
  {
    cin>>a[i][j];
  }
  vector<ll>weight(1<<n,0);
  rep(i,1<<n)
  {
    vector<ll>mem;
    rep(j,n)
    {
      if(i&(1<<j))
      {
        mem.push_back(j);
      }
    }
    rep(j,mem.size())
    {
      repi(k,j+1,mem.size())
      {
        weight[i]+=a[mem[j]][mem[k]];
      }
    }
  }
  vector<ll>dp(1<<n,0);
  rep(i,1<<n)
  {
    vector<int>bit;
    rep(j,n)if(i&(1<<j))bit.push_back(j);
    rep(j,1<<bit.size())
    {
      int cal=0;
      rep(k,bit.size())if(j&(1<<k))cal+=1<<(bit[k]);
      chmax(dp[i],dp[i-cal]+weight[cal]);
    }
  }
  cout<<dp[(1<<n)-1]<<endl;


  return 0;

}


Measured memory_bytes: 1280
#include <iostream>
#include <stdio.h>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <bitset>

typedef long long int lli;
#define rep(i,s,N) for(int i=s;i<N;i++)
#define MOD 1000000007
using namespace std;

int main(void)
{
	string A, B, C; cin >> A >> B >> C;
	int d = 'A' - 'a';
	A[0] += d;
	B[0] += d;
	C[0] += d;
	cout << A[0] << B[0] << C[0] << endl;

	return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

cnt = sum(b)
for i in range(n-1):
    if a[i] + 1 == a[i+1]:
        cnt += c[a[i]-1]
        
print(cnt)

Measured memory_bytes: 38256
using Kujikatsu001.Questions;
using Kujikatsu001.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Kujikatsu001.Questions
{
    /// <summary>
    /// https://atcoder.jp/contests/arc088/tasks/arc088_a
    /// </summary>
    public class QuestionB : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var xy = inputStream.ReadLongArray();
            var x = xy[0];
            var y = xy[1];

            int i;
            for (i = 0; x <= y; i++)
            {
                x <<= 1;
            }

            yield return i;
        }
    }
}


namespace Kujikatsu001
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionB();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace Kujikatsu001.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace Kujikatsu001.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

Measured memory_bytes: 13396
import sys
import heapq

input = sys.stdin.readline


def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort(reverse=True)
    A = [-a for a in A]

    q = [A[0]]
    heapq.heapify(q)
    ans = 0
    for a in A[1:]:
        max_v = heapq.heappop(q)
        ans += max_v
        heapq.heappush(q, a)
        heapq.heappush(q, a)

    ans = -ans
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 31460
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <cstring>
#include <regex>
#include <random>
#include <cassert>
#include <stack>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, s, n) for (int i = (s); i < (int)(n); i++)
#define revrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define revrepr(i, s, n) for (int i = (n) - 1; i >= s; i--)
#define debug(x) cerr << #x << ": " << x << "\n"
#define popcnt(x) __builtin_popcount(x)

using ll = long long;
using P = pair<int, int>;

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

template<class T>
istream& operator >>(istream &is, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
    return is;
}

template<class T, class U>
ostream& operator <<(ostream &os, pair<T, U> p) {
    cout << '(' << p.first << ", " << p.second << ')';
    return os;
}

template<class T>
void print(const vector<T> &v, const string &delimiter) { rep(i, v.size()) cout << (0 < i ? delimiter : "") << v.at(i); cout << endl; }

template<class T>
void print(const vector<vector<T>> &vv, const string &delimiter) { for (const auto &v: vv) print(v, delimiter); }

int main() {
    int n;
    cin >> n;
    vector<int> x(n);
    cin >> x;
    int l, q;
    cin >> l >> q;
    
    const int LOG_N = 17;
    vector<vector<int>> nxt(LOG_N + 1, vector<int>(n));
    int right = 0;
    rep(left, n) {
        while (right < n && x[right] - x[left] <= l) right++;
        nxt[0][left] = right - 1;
    }
    rep(k, LOG_N) rep(i, n) nxt[k + 1][i] = nxt[k][nxt[k][i]];
    
    auto query = [&](int a, int b) {
        int cnt = 0;
        revrep(k, LOG_N + 1) if (nxt[k][a] < b) {
            a = nxt[k][a];
            cnt += 1 << k;
        }
        return cnt + 1;
    };
    
    rep(_q, q) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        if (a > b) swap(a, b);
        cout << query(a, b) << endl;
    }
}

Measured memory_bytes: 9848
#include<bits/stdc++.h>
#define ll long long
#define nl "\n"
#define pi acos(-1)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define pcase printf("Case %d:\n",ca)
#define mx 5000009
int ca=1;
using namespace std;
int main(){
    string a;
    cin>>a;
    map<char,int>m;
    for(int i =0;i<a.size();i++){
        m[a[i]]++;
    }
    bool ans = true;
    for(auto i:m){
        if(i.second%2 !=0){
            ans = false;
            cout<<"No"<<nl;
            return 0;
   }
    }
    cout<<"Yes"<<nl;

}


Measured memory_bytes: 3600
import java.util.Arrays;
import java.util.Scanner;
import java.math.BigDecimal;
import java.math.BigInteger;
public class Main {
	static BigInteger n,m,one=BigInteger.valueOf(1);
	static int k;
	static char[] s=new char[10];
	static int[] l=new int[10];
	static void init() {
		for(int i=0;i<10;++i)
			s[i]=(char) (l[i]+'0');
	}
	static boolean check(BigInteger b) {
		String str=b.toString();
		for(int i=0;i<str.length();++i)
			for(int j=0;j<k;++j)
				if(str.charAt(i)==s[j])
					return false;
		return true;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n=sc.nextBigInteger();
		m=n;
		k=sc.nextInt();
		for(int i=0;i<k;++i)
			l[i]=sc.nextInt();
		init();
		while(!check(m))
			m=m.add(one);
		System.out.println(m.toString());
	}
}

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

using namespace std;
#define ll long long
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
const ll mod = 1e9 + 7;
typedef pair<int,int>           PI;
typedef pair<ll,ll>             PL;
typedef vector<PI>               vip; 
typedef vector<int>             vi;
typedef vector<vi>              vvi;
typedef vector<ll>              vl;
typedef vector<vl>              vvl;








int main (){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<vector<int>> a(2, vector<int>(n));
    REP(i,2){
        REP(j,n){
            cin >> a.at(i).at(j);
        }

    }
    int MAX = 0;
    REP(i,n){
        int b = 0;
        for(int j = 0; j <= i; j++){
            b += a.at(0).at(j);
        }
        for(int k = i; k < n; k++){
            b += a.at(1).at(k);
        }
        if(b > MAX) MAX = b;
    }

    cout << MAX << endl;






    return 0;
}

Measured memory_bytes: 256
///Astalavista Code........~CodeSlayer007
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define Br cout<<endl
#define pb push_back
#define mp make_pair
#define fe first
#define se second
#define int long long
#define double long double
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define PT(x) cout << (x) << endl
#define PTT(x) cout << (#x) << " is " << (x) << endl
#define lets_go ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
const int M = 1e9 + 7;
const int N = 1e6 + 10;
const int IM = 1e15 + 37;
const double PI = 3.1415926535897932384;
void PV(vi v) { for (int i = 0 ; i < v.size() ; i++) cout << v[i] << " " ; cout << endl;}
void PVV(vii v) {for (int i = 0 ; i < v.size() ; i++) cout << v[i].fe << " " << v[i].se << endl;}
void PA(int v[], int n, int x = 0) { for (int i = x ; i < n + x; i++)cout << v[i] << ' ' ; cout << endl;}
void IN(int a[], int n, int x = 0) {for (int i = x; i < n + x; i++)cin >> a[i];}
inline void PP(int n) { cout << n << " ";}
inline void PP(int n, int m) { cout << n << " " << m << endl;}
inline void PP(int n, int m, int q) {  cout << n << " " << m << " " << q << endl;}
inline void PP(int n, int m, int q, int u) {  cout << n << " " << m << " " << q << " " << u << endl;}
inline void op() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
// <=================================================================================================================================
// <=================================================================================================================================


signed  main() {
    //op();
    lets_go
    int i, j, x, y, u, l;
    //int t; cin >> t; while (t--)
    {
        i = j = x = y = u = l = 0;


        int n;
        cin >> n;
        string ans;
        while (n > 0) {
            n--;
            char c = 'a' + n % 26;
            ans += c;
            n = n / 26;
        }
        reverse(all(ans));
        PT(ans);


        /* */

    }
    return 0;

}


Measured memory_bytes: 3616
a[100],v,j,k,n;p(){for(k=0;k<n;printf("%d%s",a[k++],k-n+1?" ":"\n"));}main(i){scanf("%d",&n);for(;j<n;scanf("%d",&a[j++]));p();for(;i<n;i++){v=a[i];j=i-1;for(;j+1&&a[j]>v;a[j+1]=a[j--]);a[j+1]=v;p();}exit(0);}

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

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> problems(n);
    for (int i = 0; i < n; ++i) {
        cin >> problems.at(i);
    }
    sort(problems.begin(), problems.end());
    int start = problems.at(n / 2 - 1);
    int end = problems.at(n / 2);
    cout << end - start << endl;
}


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

using namespace std;

//#define PRAGMA 448
#ifdef PRAGMA
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif

#ifdef LUCARIO
#define deb(...) fprintf(stderr,__VA_ARGS__)
#define deb1(x) cerr << #x << " = " << x << endl
#else
#define deb(...) 0
#define deb1(x) 0
#endif

typedef int intt;
typedef pair<long long,long long> pll;
typedef pair<int,int> pii;

#define FIN ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ld long double
#define int long long
#define pb push_back
#define bs binary_search
#define up upper_bound
#define fs first 
#define sd second 
#define mp make_pair    
#define endl "\n"

#define fore(i,a,b) for(ll i = a; i < b; i++)
#define rfore(i, a, b) for(ll i = a - 1; i >= b; i--)
#define forev(a,b) fore(i,0,b)cout<<a[i]<<" "; 
#define ing(g,u,v)  g[u].pb(v); g[v].pb(u);
#define ingp(g,u,v,c) (g[u].pb({v,c});g[v].pb({u,c});)
#define mm(a,b) memset(a , b , sizeof a) 
#define ALL(a) a.begin(),a.end() 
#define SZ(n) ((ll) (n).size())
#define sfind(s,t) (s.find(t) != string::npos)

#define infll (ll)1e15
#define infi  (int)(1e9+1)
#define PI 3.14159265359 
#define mod (ll)(1e9+7)
#define eps  1e-6

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b,a%b); } 
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }

int n,k;
int dp[101][100001];
pii a[100001];

int solve(int i,int cos){
    if(i == -1  )return (cos == 0 ? 0 : infll);
    int &r = dp[i][cos];
    if(~r)return r;
    return r= min(solve(i-1,cos),a[i].fs+solve(i-1,cos-a[i].sd));
}

int32_t main(int32_t argc, char const *argv[]){
    FIN;
    cin>>n>>k;
    mm(dp,-1);
    fore(i,0,n)cin>>a[i].fs>>a[i].sd;
    rfore(i,100001,0){
        int p = solve(n-1,i);
        if(p <= k){
            cout<<i<<endl;
            return 0;
        }
    }

    return 0;
}


























































































































































//PROGRAMADO POR xXLucarioXx    

Measured memory_bytes: 79232
#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#define dump(...)                                                    \
    cout << "   " << string(#__VA_ARGS__) << ": "                    \
         << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" \
         << endl                                                     \
         << "   ",                                                   \
        dump_func(__VA_ARGS__)
#else
#define dump(...)
#endif

#define ll long long
#define BUF 1e5
#define INF 1 << 30
#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
constexpr ll mod = 1e9 + 7;
using namespace std;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

signed main() {
    cin >> N;
    vi a(N + 1);
    vi b(N);
    for (int i = 0; i < N + 1; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < N; i++) {
        cin >> b[i];
    }
    for (int i = 0; i < N; i++) {
        if (a[i] >= b[i]) {
            ans += b[i];
        } else {
            b[i] -= a[i];
            if (a[i + 1] > b[i]) {
                a[i + 1] -= b[i];
                ans += a[i] + b[i];
            } else {
                ans += a[i] + a[i + 1];
                a[i + 1] = 0;
            }
        }
        dump(ans, a, b);
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll MOD2 = 998244353;
const ll INF = LLONG_MAX;
const string alpha = "abcdefghijklmnopqrstuvwxyz";

int main(){
    int N, M;
    cin >> N >> M;
    int p[M];
    string s[M], x = "AC", y = "WA";
    bool ac[N+1];
    int wa[N+1];
    fill_n(ac, N+1, false);
    fill_n(wa, N+1, 0);
    int a = 0, w = 0;
    rep(i, M){
        cin >> p[i] >> s[i];
        if(s[i] == x){
            if(!ac[p[i]]) {a++; ac[p[i]] = true;}
        }
        else{
            if(!ac[p[i]]) wa[p[i]]++;
        }
    }
    rep2(i, 1, N){
        if(ac[i]) w += wa[i];
    }
    cout << a << ' ' << w << endl;
}

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

int main(void){
    int n;
    long long sum = 0;
    
    cin >> n;
    
    rep(i, n){
        sum += i;
    }
    
    cout << sum << endl;
    
    return 0;
}

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        n: usize,
        d: usize,
        ord: [[i64; 2]; n],
    }

    let mut cnt = 0;
    for i in 0..n {
        let a = ((ord[i][0].pow(2)+ord[i][1].pow(2)) as f64).sqrt();
        if a <= (d as f64) {
            cnt += 1;
        }
    }

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

Measured memory_bytes: 12800
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		String[] str = new String[H + 1];
		for(int i = 1; i < H + 1; i++) {
			str[i] = sc.next();
		}
		int[][] lump = new int[W + 1][H + 1];
		for(int i = 1; i < W + 1; i++) {
			for(int j = 1; j < H + 1; j++) {
				lump[i][j] = -1;
			}
		}
		for(int j = 1; j < H + 1; j++) {
			int wide = 0;
			int min = 0;
			for(int i = 1; i < W + 1; i++) {
				if(str[j].charAt(i - 1) == '.') {
					wide++;
					if(min == 0) {
						min = i;
					}
				} else {
					if(wide != 0) {
						for(int k = min; k < i; k++) {
							lump[k][j] += wide;
						}
						wide = 0;
						min = 0;
					}
				}
			}
			if(min != 0) {
				for(int i = min; i < W + 1; i++) {
					lump[i][j] += wide;
				}
			}
		}
		for(int i = 1; i < W + 1; i++) {
			int high = 0;
			int min = 0;
			for(int j = 1; j < H + 1; j++) {
				if(str[j].charAt(i - 1) == '.') {
					high++;
					if(min == 0) {
						min = j;
					}
				} else {
					if(high != 0) {
						for(int k = min; k < j; k++) {
							lump[i][k] += high;
						}
						high = 0;
						min = 0;
					}
				}
			}
			if(min != 0) {
				for(int j = min; j < H + 1; j++) {
					lump[i][j] += high;
				}
			}
		}
		int ans = 0;
		for(int i = 1; i < W + 1; i++) {
			for(int j = 1; j < H + 1; j++) {
				ans = Math.max(ans, lump[i][j]);
			}
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 65840
#include <stdio.h>
#include <iostream>
#include <string>
int main(void)
{
	int A, B;
	std::cin >> A >> B;
	if (A == B)
	{
		std::cout << "Draw";
	}
	else if (A == 1)
	{
		std::cout << "Alice";
	}
	else if (B == 1)
	{
		std::cout << "Bob";
	}
	if (A > B&&B!=1)
	{
		std::cout << "Alice";
	}
	else if (B > A &&A!=1)
	{
		
		std::cout << "Bob";
	}
	
	return 0;
}
	

		
	

Measured memory_bytes: 256
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7

ll N;
ll A[200005];
bool ans[200005];

int main(){
	cin >> N;
	rep(i, N) cin >> A[i];

	vector<ll> vec;
	for(ll idx = N; idx >= 1; idx--) {
		ll anum = A[idx - 1];

		ll num = 0;
		for(ll j = 2; j * idx <= N; j++) {
			ll pos = j * idx;
			if(ans[pos]) {
				num += 1;
			}

		}
		
		if(num % 2 != anum) {
			ans[idx] = true;
			vec.push_back(idx);
		}
	}

	cout << vec.size() << endl;
	for(ll i = 0; i < vec.size(); i++) {
		cout << vec[i];
		if(i != vec.size() - 1) {
			cout << " ";
		} else {
			cout << endl;
		}
	}

}


Measured memory_bytes: 6192
#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
#define mp make_pair
using namespace std;
using ll=long long;
using P=pair<int,int>;
const ll INF=1LL<<30;
const ll LINF=1LL<<61;
const double eps=1e-9;
const ll MOD=1e9+7;
int main(){
    int h,w;cin>>h>>w;
    char c[110][110];
    for(int i=0;i<h;i++){
        cin>>c[i];
    }
    vector<int> c1(h),c2(w);
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(c[i][j]=='#')c1[i]++;
        }
    }
    for(int j=0;j<w;j++){
        for(int i=0;i<h;i++){
            if(c[i][j]=='#')c2[j]++;
        }
    }
    for(int i=0;i<h;i++){
        if(c1[i]==0)continue;
        for(int j=0;j<w;j++){
            if(c2[j]==0)continue;
            cout<<c[i][j];
        }
        cout<<endl;
    }
}


Measured memory_bytes: 256
n = int(input())
*a,=map(int, input().split())
mapa=[0]*(10**6+1)

from bisect import bisect_left

n0 = 10**6
primes = set(range(2, n0+1))
for i in range(2, int(n0**0.5+1)):
    primes.difference_update(range(i*2, n0+1, i))
primeind=[0]*(10**6+1)
for p in primes:
    primeind[p]=1

def isPrime(m):
    return primeind[m]==1

def func(m):
    for i in range(2,int(m**0.5)+1):
        if isPrime(m):
            break
        if m%i==0:
            mapa[i]+=1
        while m%i==0:
            m//=i
        if m<i:
            break
    if m>1:
        mapa[m]+=1

for ai in a:
    func(ai)

tmp=max(mapa)
#print(mapa[:20])
if tmp==n:
    print('not coprime')
elif tmp>1:
    print('setwise coprime')
else:
    print('pairwise coprime')

Measured memory_bytes: 270480
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll l,r;
cin>>l>>r;
ll a[l]={};
ll gc=0;
for(ll i=0; i<l; i++){
cin>>a[i];
a[i]=abs(r-a[i]);}
gc=a[0];
for(ll i=1; i<l; i++){
gc=__gcd(gc,a[i]);}
cout<<gc<<endl;}


Measured memory_bytes: 4388
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
	vector<int> a(100);
	int b;
	int i=0;
	while(cin>>b){
		if(b!=0){
			a[i]=b;
			i++;
		}
		else if(b==0){
			cout<<a.at(i-1)<<endl;
			a.erase(a.begin()+i-1);
			i--;
		}
	}
	return 0;
}

Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s, t;
    cin >> s >> t;

    int ans = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] != t[i]) {
            ans++;
        }
    }

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

Measured memory_bytes: 3856
import java.util.HashMap;
import java.util.Scanner;
public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		HashMap<String,Integer> map=new HashMap<String,Integer>();
		int ans=0;
		for(int i=0;i<N;i++){
			String s=stdIn.next();
			if(map.containsKey(s)==false){
				ans++;
				map.put(s,1);
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 77052
#include<bits/stdc++.h>
using namespace std;
double x,a,s;
int main(){
	//freopen("p.in","r",stdin);
	//freopen("p.out","w",stdout);
	cin>>a>>s;
	x=a/s;
	printf("%.4lf\n",x);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
/* vector<int> A(N);
vector<pair<int, int> > tasks; ＃ソートした場合、１つ目でソート
tie(b, a) = p.at(i); #pair を分割
tasks.emplace_back(b, a) ＃配列 tasks の最後に (b, を追加
x の二乗 : pow(x, 2.0)
小さい順 : sort(v.begin(), v.
*/
int main() {
int A, B, C, count=0, ans=0;
string D, E, F;
cin >> D>>E>>A>>B>>F;
if(D==F)A--;
if(E==F)B--;
cout << A <<" "<<B<< endl;
}

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

using namespace std;


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

  vector<long long> lunlun;
  for (int i = 0; i < 10; i++) {
    lunlun.push_back(i);
  }

  /* lunlun数のidx */
  int idx = 1;
  int k = 9;
  while (K > k) {
    /* 現在参照しているlunlun数の下1桁が0であれば、以下の処理を行わない */
    if (lunlun[idx] % 10 != 0) {
      lunlun.push_back(lunlun[idx]*10 + lunlun[idx]%10 - 1);
      k--;
    }

    lunlun.push_back(lunlun[idx]*10 + lunlun[idx]%10);
    
    /* 現在参照しているlunlun数の下1桁が9であれば、以下の処理を行わない */
    if (lunlun[idx] % 10 != 9) {
      lunlun.push_back(lunlun[idx]*10 + lunlun[idx]%10 + 1);
      k--;
    }
    k += 3;
    idx++;
  }

  cout << lunlun[K] << endl;
  return 0;
}

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

void solve(long long N)
{
    cout << floor((N + 1) / 2) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    solve(N);
    return 0;
}


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

int main()
{
    int n;
    string s, tmp1, tmp2;
    cin >> s;

    tmp1=s;
    tmp2=s;
    reverse(tmp1.begin(), tmp1.end());
    if (s.compare(tmp1) != 0)
    {
        cout << "No" << endl;
        return 0;
    }

    // cout << s.substr(0, (s.length() - 1) / 2) << endl;
    tmp1 = s.substr(0, (s.length() - 1) / 2);
    tmp2 = s.substr(0, (s.length() - 1) / 2);
    reverse(tmp2.begin(), tmp2.end());
    // cout << tmp1 << " " << tmp2 << endl;
    if (tmp1.compare(tmp2) != 0)
    {
        cout << "No" << endl;
        return 0;
    }
    tmp1 = s.substr((s.length() + 1) / 2, (s.length() - 1) / 2);
    tmp2 = s.substr((s.length() + 1) / 2, (s.length() - 1) / 2);
    reverse(tmp2.begin(), tmp2.end());
    // cout << tmp1 << " " << tmp2 << endl;
    if (tmp1.compare(tmp2) != 0)
    {
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3624
object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N, M = sc.nextInt()

    val prefectures = Array.fill(N+1)(
      scala.collection.mutable.ArrayBuffer.empty[Int])
    val result = new Array[String](M)
    val year = new Array[Int](M)

    (0 until M) foreach { i =>
      val p = sc.nextInt()
      year(i) = sc.nextInt()
      prefectures(p).append(i)
    }

    @inline val format = (n: Long) => "%012d".format(n)

    (1 to N). foreach { p =>
      val prefecture = prefectures(p).sortBy(i => year(i))
      val l = prefecture.size
      var i = 1
      while (i <= l) {
        val city = prefecture(i-1)
        result(city) = format(p * 1000000L + i)
        i += 1
      }
    }

    println(result.mkString("\n"))

  }

}


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

int main(){
  uint32_t N, X, T;
  cin >> N >> X >> T;
  if( N % X == 0 ){
    cout << N / X  * T << endl;
  }else{
    cout << (N / X + 1 ) * T << endl;
  }
}

Measured memory_bytes: 3628
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <unordered_map>
#include <map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>
 
class Union_Find {
    public:
    std::vector<int> par;
    Union_Find() {}
    Union_Find(int n){
        par.resize(n, 0);
        for(int i = 0; i < n; i++){
            par[i] = i;
        }
    }

    void simplify(int x) {
        std::vector<int> path;
        while (par[x] != x) {
            path.push_back(x);
            x = par[x];
        }
        for (int p : path) {
            par[p] = x;
        }
    }
    
    int find(int x){
        simplify(x);
        return par[x];
    }
    
    void unite(int x, int y){
        x = find(x);
        y = find(y);
        if (x != y) {
            par[y] = x;
            // 改造する時は「根になっているノードの親を変更する」という原則が守られていることに注意。
        }
    }
};

const int MAX_N = 200050;
const int MAX_K = 100050;

int N, K, L;
int p[MAX_K], q[MAX_K], r[MAX_K], s[MAX_K];

Union_Find uni_load = Union_Find(MAX_N);
Union_Find uni_train = Union_Find(MAX_N);
 
int main(void){
    std::cin >> N >> K >> L;

    for (int i = 1; i <= K; i++) {
        std::cin >> p[i] >> q[i];
    }
    for (int i = 1; i <= L; i++) {
        std::cin >> r[i] >> s[i];
    }
    
    for(int i = 1; i <= K; i++){
        uni_train.unite(p[i], q[i]);
    }
    
    for(int i = 1; i <= L; i++){
        uni_load.unite(r[i], s[i]);
    }
    
    std::unordered_map<long long, int> S;
    for(int i = 1; i <= N; i++){
        long long tmp = (long long)uni_load.find(i) * MAX_N + uni_train.find(i);
        if (S.find(tmp) != S.end()) {
            S[tmp] += 1;
        } else {
            S[tmp] = 1;
        }
    }
    
    for(int i = 1; i <= N; i++){
        long long tmp = (long long)uni_load.find(i) * MAX_N + uni_train.find(i);
        std::cout << S[tmp] << " ";
    }
    std::cout << std::endl;
    
    return 0;
}

Measured memory_bytes: 11464
#include<bits/stdc++.h>
using namespace std;
int main()
{
    stack<int>st;
    string s;
    while(cin>>s){
        int a,b;
        if(s=="+"){
            a=st.top();st.pop();
            b=st.top();st.pop();
            st.push(b+a);
        }else if(s=="-"){
            a=st.top();st.pop();
            b=st.top();st.pop();
            st.push(b-a);
        }else if(s=="*"){
            a=st.top();st.pop();
            b=st.top();st.pop();
            st.push(b*a);
        }else st.push(atoi(s.c_str()));
    }
    cout<<st.top()<<"\n";
}



Measured memory_bytes: 3232
#include <stdio.h>

int main(){
	int a,b,c;
	int ans;
	scanf("%d%d%d",&a,&b,&c);

	if(b>=c){
		printf("%d\n",b+c);
	}else if(a+b>=c){
		printf("%d\n",b+c);
	}else {
		printf("%d\n",1+a+2*b);
	}
}

Measured memory_bytes: 128
#include <iostream> 
#include <vector>
#include <algorithm>
#include <cmath>
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define debug freopen("input", "r", stdin);freopen("output", "w", stdout)
#define endl '\n'
#define all(var) var.begin(), var.end()
typedef unsigned long long ll;
int const MOD = 1e9+7;
using namespace std;

int main(){
    int n, m;
    cin >> n >> m;
    auto genpair = [](int n){
        return n*(n-1)/2;
    };
    cout << genpair(n)+genpair(m) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)


void solve(long long N, long long K){
    N %= K;
    cout << min(abs(N - K), N) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    solve(N, K);
    return 0;
}


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

using namespace std;

int Power(int base, int exp, int mod)
{
    if (exp == 0) {
        return 1;
    } else if (exp == 1) {
        return base % mod;
    }

    if (exp % 2 == 1) {
        return 1LL * base * Power(base, exp - 1, mod) % mod;
    }

    auto root = Power(base, exp / 2, mod);
    return 1LL * root * root % mod;
}

bool Correct(const vector<int> &count)
{
    if (count.size() % 2 == 1 && count[0] != 1) {
        return false;
    }

    for (size_t i = 1 + count.size() % 2; i < count.size(); i += 2) {
        if (count[i] != 2) {
            return false;
        }
    }
    return true;
}

int Solve(const vector<int> &count)
{
    if (!Correct(count)) {
        return 0;
    }

    const int kMod = 1e9 + 7;
    return Power(2, count.size() / 2, kMod);
}

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

    vector<int> count(n, 0);
    for (auto i = 0; i < n; i += 1) {
        int diff;
        cin >> diff;
        count[diff] += 1;
    }

    auto res = Solve(count);
    cout << res << "\n";

    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

/*
using PAIR = pair<string, int>;
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA() cerr << "AAAAA" << endl
#define debug_() cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

using Graph = vector<vector<int>>;
using P = pair<int, int>;
const int INF = 1001001001;
const double pi = acos(-1);

struct UnionFind
{
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N)
    { //最初は全てが根であるとして初期化
        for (int i = 0; i < N; i++)
            par[i] = i;
    }

    int root(int x)
    { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x)
            return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y)
    {                     // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry)
            return;   //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y)
    { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

using P1 = pair<int, pair<int, int>>;

int main()
{
    int n, m;
    cin >> n >> m;
    priority_queue<P1, vector<P1>, greater<P1>> que;
    for (int i = 0; i < m; i++)
    {
        int a, b, c;
        cin >> a >> b >> c;
        que.push({c, {a, b}});
    }

    UnionFind tree(n);
    int ans = 0;
    while (!que.empty())
    {
        int cost = que.top().fi;
        int a = que.top().se.fi;
        int b = que.top().se.se;
        que.pop();
        if (!tree.same(a, b))
        {
            tree.unite(a, b);
            ans += cost;
        }
    }
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 4528
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    vector<string> V(N);
    for(int i = 0; i < N; i++){
        cin >> V.at(i);
    }
    sort(V.begin(), V.end());
    V.erase(std::unique(V.begin(), V.end()), V.end());
    cout << V.size() << endl;
}


Measured memory_bytes: 9596
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] strs = new String[2];
		int n=0, x=0, count=0;
		ArrayList<Integer> result = new ArrayList<Integer>();
		while(true)
		{
			strs = br.readLine().split(" ");
			n = Integer.parseInt(strs[0]);
			x = Integer.parseInt(strs[1]);
			if(n==0 && x==0)	break;
			for(int i=1; i<=n; i++)
			{
				for(int j=i+1; j<=n; j++)
				{
					for(int k=j+1; k<=n; k++)
					{
						if(i+j+k==x)
						{
							count++;
						}
					}
				}
			}
			result.add(count);
			count = 0;
		}
		for(int cnt=0; cnt<result.size(); cnt++)
		{
			System.out.println(result.get(cnt));
		}
	}
}

Measured memory_bytes: 25504
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>

using namespace std;

long long n; 


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

    int moves = 0;
    int total_rs = 0;
    for(int i = 0; i < n; i++){
        if(str[i] == 'R'){
            total_rs++;
        }
    }

    int temp = 0;
    for(int i = 0; i < total_rs; i++){
        if(str[i] == 'R'){
            temp++;
        }
    }

    cout << total_rs - temp << endl;
}

Measured memory_bytes: 3756
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int a,b,t;

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  cin >> a >> b >> t;
  cout << (t/a)*b << endl;


return 0;
}
///....


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>

int main(){
   int H, W;
   std::cin >> H >> W;
   std::vector<std::string> s(H);
   for (int i=0; i<H; i++){
      std::cin >> s.at(i);
   }
   std::vector<std::vector<char>> s2(H+2, std::vector<char>(W+2));
   for (int i=0; i<H+2; i++){
      for (int j=0; j<W+2; j++){
         if ((i == 0) || (i == H+1)){
            s2.at(i).at(j) = '.';
         } else if ((j == 0) || (j == W+1)){
            s2.at(i).at(j) = '.';
         } else {
            s2.at(i).at(j) = s.at(i-1).at(j-1);
         }
      }
   }

   for (int i=0; i<H+2; i++){
      for (int j=0; j<W+2; j++){
         std::cerr << s2.at(i).at(j) << " ";
      }
      std::cerr << std::endl;
   }

   bool flag = true;
   for (int i=1; i<H+1; i++){
      for (int j=1; j<W+1; j++){
         if (s2.at(i).at(j) == '#'){
            if (!((s2.at(i-1).at(j) == '#') ||
                  (s2.at(i+1).at(j) == '#') ||
                  (s2.at(i).at(j-1) == '#') ||
                  (s2.at(i).at(j+1) == '#'))){
               flag = false;
               break;
            }
         }
      }
   }

   if (flag)
      std::cout << "Yes" << std::endl;
   else
      std::cout << "No" << std::endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define MAXV 10001

int main(){
    int box[MAXV], i;
    i = 0;
    while(true){
        cin >> box[i];
        if(box[i] == 0){
            break;
        }
        i++;
    }
    i = 0;
    while(true){
        if(box[i] == 0){
            break;
        }
        cout << "Case " << i+1 << ": " << box[i] << endl;
        i++;
    }
}


Measured memory_bytes: 3092
#!/usr/bin/env python
# -*- coding: utf-8 -*-

s = input()

s_len = len(s)

pre_half_str = s[0:int((s_len-1)/2)]
latter_half_str = s[int((s_len+2)/2):]

if "".join(reversed(s)) == s:
    if "".join(reversed(pre_half_str)) == pre_half_str:
        if "".join((reversed(latter_half_str))) == latter_half_str:
            print("Yes")
            exit()

print("No")

Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
using pll = pair<long long,long long>;

int main(){
    int N; cin >> N;
    for(int i = 1; i <= N; i++){
        long long ans = 0;
        map<tuple<int,int,int>,int> mp;
        for(int x = 1; x * x <  i; x++){
            for(int y = x; x * x + y * y + x * y <= i ; y++){
                    for(int z = y; x * x + y * y + z * z + x * y + y * z + z * x <= i; z++){
                        if(x * x + y * y + z * z + x * y + y * z + z * x == i){
                            ///cout <<i <<" "<< x <<" "<<  y <<" "<< z << endl;
                            if(mp[make_tuple(x,y,z)]==1)continue;
                            mp[make_tuple(x,y,z)] = 1;
                            mp[make_tuple(x,z,y)] = 1;
                            mp[make_tuple(y,x,z)] = 1;
                            mp[make_tuple(y,z,x)] = 1;
                            mp[make_tuple(z,x,y)] = 1;
                            mp[make_tuple(z,y,x)] = 1;                     
                            
                            if(x == y && y == z) ans++;
                            else if(x == y || y == z || z == x) ans += 3;
                            else ans += 6; 
                        }   
                }
            }
        }
        cout << ans << endl;
    }
}




Measured memory_bytes: 3488
#include <stdio.h>

using namespace std;

#define REP(a, i, n) for (int i = a; i < n; ++i)

int main() {
    int A, B, C, X;
    scanf("%d %d %d %d", &A, &B, &C, &X);

    int ans = 0;
    REP(0, i, A + 1) REP(0, j, B + 1) REP(0, k, C + 1) {
        if (500 * i + 100 * j + 50 * k == X) {
            ans++;
        }
    }

    printf("%d\n", ans);

    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String S = sc.next();

		if (n % 2 != 0) {
			System.out.println("No");
			sc.close();
			return;
		}

		StringBuilder firstHalf = new StringBuilder();
		StringBuilder secondHalf = new StringBuilder();
		for (int i = 0; i < n; i++) {
			char charS = S.charAt(i);
			if (i < n / 2) {
				firstHalf.append(charS);
			} else {
				secondHalf.append(charS);
			}
		}

		if (firstHalf.toString().equals(secondHalf.toString())) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}

}

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


int main() {
    int N;
    cin >> N;
    vector<double> v(N);
    for(int i = 0;i<N;i++) cin >> v[i];
    sort(v.begin(), v.end());
    double x = v[0];
    for(int i = 0;i<N-1;i++) {
        x = (x+v[i+1])/2.0; 
    }
    cout << x << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ford(i,a,b) for(int i=(a);i>=b;i--)
#define rep1(i,a,b) for(int i=(a);(i)<=(b);(i)++)
#define rep(i,a,b) for(int i=(a);(i)<(b);(i)++)
#define ll long long
#define N 105
#define pql priority_queue<ll>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define rev(a,n) reverse(a,a+n)
using namespace std;
int n,h[N],ans; 
int main() {
	cin>>n;
	rep(i,0,n) cin>>h[i];
	rep(i,0,n) {
		while(h[i]>0) {
        	rep(j,i,n) {
                if(h[j]>0) h[j]--;
                else break;
            }
            ans++;
        }
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3660