akhauriyash/Code-Regression huggingface dataset:
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/*
 * AtCoder Beginner Contest 088 A "Infinite Coins"
 *   https://abc088.contest.atcoder.jp/tasks/abc088_a/
 */
public class Main {

	public static void main(String[] args) {

		InputScanner in = new InputScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int N = in.nextInt();
		int A = in.nextInt();

		if (N % 500 <= A) {
			out.println("Yes");
		} else {
			out.println("No");
		}

		in.close();
		out.close();
	}

	/*
	 * extends java.util.Scanner
	 */
	static class InputScanner {

		Scanner scanner;

		public InputScanner(InputStream inputStream) {
			this.scanner = new Scanner(inputStream);
		}

		public int nextInt() {
			return scanner.nextInt();
		}

		public long nextLong() {
			return scanner.nextLong();
		}

		public double nextDouble() {
			return scanner.nextDouble();
		}
		public String next() {
			return scanner.next();
		}

		public int[] nextIntArray(int n) {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextInt();
			}
			return ret;
		}

		public int[][] nextIntArray(int h, int w) {
			int[][] ret = new int[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextInt();
				}
			}
			return ret;
		}

		public long[] nextLongArray(int n) {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextLong();
			}
			return ret;
		}

		public long[][] nextlongArray(int h, int w) {
			long[][] ret = new long[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public double[] nextDoubleArray(int n) {
			double[] ret = new double[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.nextDouble();
			}
			return ret;
		}

		public double[][] nextDoubleArray(int h, int w) {
			double[][] ret = new double[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.nextLong();
				}
			}
			return ret;
		}

		public String[] nextStringArray(int n) {
			String[] ret = new String[n];
			for (int i = 0; i < n; i++) {
				ret[i] = scanner.next();
			}
			return ret;
		}

		public String[] nextStringArray(String split) {
			String[] ret = scanner.next().split(split);
			return ret;
		}

		public String[][] nextStringArray(int h, int w) {
			String[][] ret = new String[h][w];
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					ret[i][j] = scanner.next();
				}
			}
			return ret;
		}

		public String[][] nextStringArray(int h, String split) {
			String[][] ret = new String[h][];
			for (int i = 0; i < h; i++) {
				ret[i] = scanner.next().split(split);
			}
			return ret;
		}

		public void close() {
			scanner.close();
		}

	}

}


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

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <map>
#include <queue>
#define mp make_pair
#define pb push_back
#define p push
#define FOR(a,c) for(int a = 0;a<c;a++)
#define ll long long
#define abs(x) (x<0 ? (-x) : x)
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d %d",&a,&b)
#define getIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define getL(a) scanf("%lld",&a)
#define getLL(a,b) scanf("%lld %lld",&a,&b)
#define getLLL(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define BEND(c) (c).begin(),(c).end()
#define fi first
#define se second
#define PI 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d",a);
#define pfii(a,b) printf("%d%d",a,b);
#define pfl(a) printf("%lld",a);
#define pfll(a,b) printf("%lld%lld",a,b);
#define SIZE 1000000007

using namespace std;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvl;
typedef vector<long long> vl;
typedef vector<pair<int,int>> vpi;
typedef vector<pair<long long,long long>> vpl;
typedef vector<vector<pair<long long,long long>>> vvpl;
typedef vector<bool> vb;
typedef pair<int,int> pii;
typedef pair <ll,ll> pll;
const  double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MX = 200005;
/*ios_base::sync_with_stdio(false);cin.tie(0);*/

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

long long fast_exp(long long n,long long k){
    if(k == 0)
        return 1;
    if(k==1)
        return n;

    long long temp = fast_exp(n,k>>1);

    if((k&1)==1)
        return (n*temp*temp)%SIZE;
    return (temp*temp)%SIZE;

}

int main() {
   ll n,k;
   cin >>n>>k;
    ll ans =0;
    if ( k == 1 ){
        cout << ans;
        return 0;
    }



        while(k > 0 ){
            ans++;
            k -= n;
            if ( k == 0)break;
            k++;

        }
        //cout << n<<" "<<k<<" ";
        cout << ans;



    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++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    int n;
    string s;
    cin >> n >> s;
    int left = 0, right = n-1;
    int ans = 0;
    while(left < right){
        while (right >= 0 && s[right] != 'R') right--;
        while (left < n && s[left] != 'W') left++;
        if (left >= right) break;
        ans++;
        s[left] = 'R';
        s[right] = 'W';
        left++;
        right--;
    }
    int wNum = 0;
    rep(i,n){
        if (s[i] == 'W') wNum++;
    }
    cout << min(ans, wNum) << endl;
    return 0;
}

Measured memory_bytes: 3740
#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
typedef pair<int,int> P;
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define rep(i, n) for (lint i = 0; i < (n); i++)
#define INF LLONG_MAX
#define all(x) (x).begin(),(x).end()
#define pb push_back
int count (int a){
    int count=0;
    double t=a;
    while(1){
        if((a%2)==0){
            t/=2;
            a=t;
            count++;
        }else{
            break;
        }
    }    
    return count;
}
int main(){
    int n;
    cin>>n;
    int a[n];
    int ans=0;
    rep(i,n){
        cin>>a[i];
        ans+=count(a[i]);
    }
    cout<<ans<<endl;
    return 0;
}

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

typedef long long  ll;

ll MOD = 1000000007;
ll INF = 100000000000000;
double PI = 3.1415926535;

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<pair<ll,ll>>>;

Graph G(100010);

int table[100010];

void dfs(int x,int a){
  int n = G[x].size();
  
  for(int i = 0;i < n;i++){
    int y = G[x][i].first;
    if(y == a){
      continue;
    }
    //cout << y << endl;
    if(G[x][i].second % 2 == 0){
      if(table[x] == 0){
        table[y] = 0;
      }else{
        table[y] = 1;
      }
    }else{
      if(table[x] == 0){
        table[y] = 1;
      }else{
        table[y] = 0;
      }
    }
    dfs(y,x);
  }
  return ;
}

int main(){
  int N;cin >> N;
  for(int i = 0;i < N-1;i++){
    int a,b,c;cin >> a >> b >> c;
    a--;b--;c %= 2;
    G[a].push_back(make_pair(b,c));
    G[b].push_back(make_pair(a,c));
  }
  dfs(0,-1);
  for(int i = 0;i < N;i++){
    cout << table[i] << endl;
  }
}


Measured memory_bytes: 10624
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#define int long long
using namespace std;

signed main() {
	int N;
	cin >> N;
	if(N < 105) {
		cout << 0 << endl;
	}
	else if(N < 135) {
		cout << 1 << endl;
	}
	else if(N < 165) {
		cout << 2 << endl;
	}
	else if(N < 189) {
		cout << 3 << endl;
	}
	else if(N < 195) {
		cout << 4 << endl;
	}
	else {
		cout << 5 << endl;
	}
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>

using namespace std;
using llong = long long;
const int MOD=1000000007;


int main(int argc, char**argv){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];

    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());

    int alice = 0;
    for (int i = 0; i < n; i+=2){
        alice += a[i];
    }
    int bob = accumulate(a.begin(), a.end(), 0) - alice;

    cout << alice - bob << endl;


    return 0;
}







Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(int argc, char *argv[])
{
    int N, Sn, x, y;
    scanf("%d", &N);
    if (N < 1 || N > pow(10, 9))
        exit(1);
    y = N;
    while (y)
    {
        x = y % 10;
        Sn = Sn + x;
        y = y / 10;
    }
    if (Sn != 0 && N % Sn == 0)
        printf("Yes");
    else
        printf("No");
    return 0;
}

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

namespace ConsoleApp1
{
    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            B();
        }

        static void B()
        {
            var HW = ReadSplitInt();
            var list = new List<string>();
            for (int i = 0; i < HW[0]; i++)
                list.Add($"#{Read()}#");

            for (int i = 0; i < list[0].Length; i++)
                Console.Write("#");

            Console.WriteLine();
            foreach (var l in list)
                Console.WriteLine(l);

            for (int i = 0; i < list[0].Length; i++)
                Console.Write("#");
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int DigitsSum(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static IList<string> ReadSplit() => Read().Split().ToList();
        static IList<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
    }
}

Measured memory_bytes: 13396
/*#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include<bits/stdc++.h>
#define ll long long
#define inf 1000000005
#define mod 1000000007
#define put putchar('\n')
#define F(i,a,b) for (int i=(a);i<=(b);i++)
#define D(i,a,b) for (int i=(a);i>=(b);i--)
#define go(i,t) for (int i=head[t];i;i=Next[i])
#define sqr(x) ((x)*(x))
#define re register
#define mp make_pair
#define fi first
#define se second
#define pa pair<int,int>
#define pb push_back
#define be begin()
#define en end()
#define ret return puts("-1"),0;
#define N 1000055
#define int ll
using namespace std;
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline int read(){char c=getchar();int tot=1;while ((c<'0'|| c>'9')&&c!='-') c=getchar();if (c=='-'){tot=-1;c=getchar();}
int sum=0;while (c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}return sum*tot;}
inline void wr(int x){if (x<0) {putchar('-');wr(-x);return;}if(x>=10)wr(x/10);putchar(x%10+'0');}
inline void wrn(int x){wr(x);put;}inline void wri(int x){wr(x);putchar(' ');}
inline void wrn(int x,int y){wri(x);wrn(y);}inline void wrn(int a,int b,int c){wri(a);wrn(b,c);}
int n,m,ans,num,vis[N],f[N],g[N],x,y,inv[N];
struct xx{
	int c,w;
}z[N];
int nedge,Next[N*2],to[N*2],head[N];
void add(int a,int b){
	Next[++nedge]=head[a];head[a]=nedge;to[nedge]=b;
}
#define V to[i]
bool cmp(xx a,xx b){
	return a.w<b.w;
} 
void dfs(int x,int p){
	vis[x]=1;num++;ans=(ll)ans*num%mod;
	if (g[z[x].c]!=p) f[z[x].c]=0;g[z[x].c]=p;
	ans=(ll)ans*inv[++f[z[x].c]]%mod;
	go(i,x) if (!vis[V]) dfs(V,p);
}
signed main(){
	n=read();x=read();y=read();
	F(i,1,n){
		z[i].c=read();z[i].w=read();
	}
	inv[1]=1;
	F(i,2,n) inv[i]=(ll)(mod-mod/i)*(inv[mod%i])%mod;
	sort(z+1,z+n+1,cmp);
	F(i,2,n){
		if (z[i].c!=z[1].c){
			num=i;break;
		}
	}
	F(i,2,n){
		if (z[i].c!=z[1].c){
			if (z[i].w+z[1].w<=y)
			add(i,1),add(1,i);
		}
		else if (num&&z[i].w+z[num].w<=y) add(i,num),add(num,i);
	}
	F(i,1,n){
		if (!vis[z[i].c]) vis[z[i].c]=i;
		else{
			if (z[i].w+z[vis[z[i].c]].w<=x) add(i,vis[z[i].c]),add(vis[z[i].c],i);
		}
	}
	F(i,1,n) vis[i]=0;
	ans=1;
	F(i,1,n) if (!vis[i]) num=0,dfs(i,i);
	wrn(ans);
	return 0;
}
/*
2 5 5
1 1
1 3
*/

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

int main(void){
  string s, t;
  cin >> s >> t;
  
  long a,b;
  cin >> a >> b;
  
  string u;
  cin >> u;
  
  if (s == u){
    cout << a - 1 << " " << b << endl;
  }else {
    cout << a << " " << b - 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int A,B,C;
    cin >> A >> B >> C;
    
    int o=0;
    o+=(C/(7*A+B))*7+min(7,(C%(7*A+B))/A);
   if((C%(7*A+B))%A>0 and (C%(7*A+B))<7*A)o++;
    cout << o <<endl;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  string s;cin >> s;
  bool sat = false;
  rep(i,s.length()-1){
    if(s[i] == 'A' && s[i+1] == 'C') sat = true;
  }
  YesNo(sat);
  return 0;
}


Measured memory_bytes: 256
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
 
#define mp make_pair
#define f first
#define s second
#define ll long long
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
 
using namespace std;
 
using namespace __gnu_pbds;
template <typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
const int inf = 2e9+7, mod=1e9+7;
const int N = 3e5+134, N1=1e7+134;
 
ll xx[8]={1, 1, -1, -1, 1, -1, 0, 0};
ll yy[8]={1, -1, 1, -1, 0, 0, 1, -1};

int a[N];
 
int main(){
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
	int k, n;
	cin >> k >> n;
	for(int i=0; i<n; i++){
		cin >> a[i];
	}
	sort(a, a+n);
	a[n]=a[0];
	int ans=0;
	for(int i=1; i<n; i++){
		ans=max(ans, abs(a[i]-a[i-1]));
	}
	ans=max(ans, k-(a[n-1]-a[n]));
	cout << k-ans;
    return 0;
}

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

int main(){
  long long H;
  cin >> H;
  if(H==1){
    cout<<"1"<<endl;
    return 0;
  }
  long long count=0;
  while(H>1){
    count++;
    H=H/2;
  }
  cout<<(long long)pow(2,count+1)-1<<endl;

  return 0;

}


Measured memory_bytes: 256
x = int(input())

if 400 <= x <= 599:
  print(8)
elif 600 <= x <= 799:
  print(7)
elif 800 <= x <= 999:
  print(6)
elif 1000 <= x <= 1199:
  print(5)
elif 1200 <= x <= 1399:
  print(4)
elif 1400 <= x <= 1599:
  print(3)
elif 1600 <= x <= 1799:
  print(2)
elif 1800 <= x <= 1999:
  print(1)

Measured memory_bytes: 9188
#include<iostream>

using namespace std;


int main(void){

	int a, b, c, d, e;

	cin >> a >> b >> c >> d >> e;
	if (a < 40) a = 40;
	if (b < 40) b = 40;
	if (c < 40) c = 40;
	if (d < 40) d = 40;
	if (e < 40) e = 40;
	cout << (a + b + c + d + e) / 5 << endl;

	return 0;
}

Measured memory_bytes: 1160
import sys
from heapq import heappush, heappop, heapify

V, E = map(int, sys.stdin.readline().strip().split())

graph = [[] for _ in range(V)]
for _ in range(E):
	s, t, w = map(int, sys.stdin.readline().strip().split())
	graph[s].append((w, t))
	graph[t].append((w, s))
	
used = set()
q = []
for i in range(V):
    if len(graph[i]):
        for w, t in graph[i]:
            q.append((w, t))
        used.add(i)
        break
heapify(q)

ans = 0
while q:
    w, s = heappop(q)
    if s in used:
        continue
    used.add(s)
    ans += w
    for w, t in graph[s]:
        if t in used:
            continue
        heappush(q, (w, t))

print(ans)


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

#define FOR(i,a,b) for(int i= (a); i<((int)b); ++i)
#define RFOR(i,a) for(int i=(a); i >= 0; --i)
#define FOE(i,a) for(auto i : a)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v,x) (std::find(v.begin(), v.end(), x) != v.end())
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());

typedef long long LL;
template<typename T> using V = std::vector<T>;
template<typename T> using VV = std::vector<std::vector<T>>;
template<typename T> using VVV = std::vector<std::vector<std::vector<T>>>;

template<class T> inline T ceil(T a, T b) { return (a + b - 1) / b; }
template<class T> inline void print(T x) { std::cout << x << std::endl; }
template<class T> inline bool inside(T y, T x, T H, T W) {return 0 <= y and y < H and 0 <= x and x < W; }
template<class T> inline double euclidean_distance(T y1, T x1, T y2, T x2) { return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); }
template<class T> inline double manhattan_distance(T y1, T x1, T y2, T x2) { return abs(x1 - x2) + abs(y1 - y2); }

const int INF = 1L << 30;
const double EPS = 1e-9;
const std::string YES = "YES", Yes = "Yes", NO = "NO", No = "No";
const std::vector<int> dy4 = { 0, 1, 0, -1 }, dx4 = { 1, 0, -1, 0 };    // 4近傍（右, 下, 左, 上）
const std::vector<int> dy8 = { 0, -1, 0, 1, 1, -1, -1, 1 }, dx8 = { 1, 0, -1, 0, 1, 1, -1, -1 };

using namespace std;

const int MOD = 1000000000 + 7;


class FenwickTree{
public:
    const unsigned long n;
    vector<long long> v;

    FenwickTree(unsigned long n) : n(n) {
        this->v.assign(n + 1, 0);
    }

    // sum(v[0, i))
    long long sum(int i) {
        assert(0 <= i && i <= this->n);

        long long s = 0;
        i -= 1;
        while (i >= 0) {
            s += this->v[i];
            i = (i & (i + 1)) - 1;
        }
        return s;
    }

    // sum(v[left, right))
    long long sum(int left, int right) {
        assert(left <= right);
        return this->sum(right) - this->sum(left);
    }

    // v[i] += x(0-origin)
    void add(int i, long long x) {
        assert(i < this->n);

        while (i < this->n) {
            this->v.at(i) += x;
            i |= i + 1;
        }
    }
};

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

    int N, Q;
    cin >> N >> Q;

    FenwickTree ft(N + 2);

    FOR(i, 0, Q) {
        int com, x, y;
        cin >> com >> x >> y;
        if (com == 0) {
            ft.add(x, y);
        }
        else {
            print(ft.sum(x, y + 1));
        }
    }

    return 0;
}


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

int main() {
  int x;
  cin >> x;
  int a, b;
  if(x!=0){
    a = x / 500;
    b = (x%500)/5;
    cout << a*1000+b*5 << endl;
  }else{
    cout << "0" << endl;
  }
}


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

int main() {
  int N,L;
  cin >> N >> L;
  
  vector<string>vec(N);
    
  for(int i =0; i < N; i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  
  for(int i =0; i < N; i++){
    cout << vec.at(i);
  }
  
  
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A1, A2, A3;
  cin >> A1 >> A2 >> A3;
  if (A1+A2+A3 > 21) cout << "bust" << endl;
  else cout << "win" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=998244353;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

struct mint{
	ll x;
	mint(ll x=0):x((x%mod+mod)%mod){}
	friend ostream &operator<<(ostream& os,const mint& a){
		return os<<a.x;
	}
	friend istream &operator>>(istream& is,mint& a){
		ll t;
		is>>t;
		a=mint(t);
		return (is);
	}
	mint& operator+=(const mint a){
		if((x+=a.x)>=mod) x-=mod;
		return *this;
	}
	mint& operator-=(const mint a){
		if((x+=mod-a.x)>=mod)x-=mod;
		return *this;
	}
	mint& operator*=(const mint a){
		(x*=a.x)%=mod;
		return *this;
	}
	mint operator+(const mint a) const{
		mint res(*this);
		return res+=a;
	}
	mint operator-(const mint a) const{
		mint res(*this);
		return res-=a;
	}
	mint operator*(const mint a) const{
		mint res(*this);
		return res*=a;
	}
	mint pow(ll t) const{
		if (!t) return 1;
		mint a=pow(t>>1);
		a*=a;
		if(t&1) a*=*this;
		return a;
	}
	// for prime mod
	mint inv() const{
		return pow(mod-2);
	}
	mint& operator/=(const mint a){
		return (*this)*=a.inv();
	}
	mint operator/(const mint a) const{
		mint res(*this);
		return res/=a;
	}
};

struct combination{
  vector<mint> fact,ifact;
  combination(int n):fact(n+1),ifact(n+1){
	assert(n<mod);
	fact[0]=1;
	for(int i=1;i<=n;i++) fact[i]=fact[i-1]*i;
	ifact[n]=fact[n].inv();
	for(int i=n;i>=1;i--) ifact[i-1]=ifact[i]*i;
  }
  mint operator()(int n,int k){
	if (k<0 || k>n) return 0;
	return fact[n]*ifact[k]*ifact[n-k];
  }
};

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	ll n,m,k;
	cin>>n>>m>>k;
	combination comb(300000);
	mint ans=0;
	rep(i,k+1){
		ans+=comb(n-1,i)*mint(m)*mint(m-1).pow(n-i-1);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 7956
# https://maspypy.com/atcoder-%E5%8F%82%E5%8A%A0%E6%84%9F%E6%83%B3-2019-02-16abc-155
import numpy as np

N, K = map(int, input().split())
A = np.array(list(map(int, input().split())))
A.sort()
G = A[A > 0]
Z = A[A == 0]
L = A[A < 0]

ok = 10 ** 18 + 1
ng = -10 ** 18 - 1

# x以下がK個以上であるxの最小値

while ok - ng > 1:
    mid = (ng + ok) // 2
    # mid以下のペアの個数を数える

    # 正のもののうち、mid以下のペアの個数を数える
    cg = np.searchsorted(A, mid // G, side="right").sum()

    # 負のもののうちmid以下のペアの個数を数える
    cl = (N - np.searchsorted(A, (-mid - 1) // (-L), side="right")).sum()

    # 同じ数字同士の積がmid以下のものを数える
    d = np.count_nonzero(A * A <= mid)

    # 0がmid以下なら、それもプラスするために必要
    z = 0
    if mid >= 0:
        z += len(Z) * N

    c = cg + cl + z - d

    # 二重になっているので、割る
    c //= 2

    # mid以下のペアの個数がK個以上のとき
    if c >= K:
        ok = mid
    else:
        ng = mid

print(ok)


Measured memory_bytes: 47640
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,a;
    while (cin>>n) {
        if (n==0) {
            break;
        } else {
            std::deque<int> deq;
            for (int i=0;i<n;i++) {
                cin>>a;
                deq.emplace_back(a);
            }
            int min=1000000;
            for (int j=0;j<deq.size()-1;j++) {
                for (int k=j+1;k<deq.size();k++) {
                    if (abs(deq[j]-deq[k])<min) {
                        min=abs(deq[j]-deq[k]);
                    }
                }
            }
            cout<<min<<endl;
        }
    }
}



Measured memory_bytes: 3108
import sys


def partition(A, p, r):
    x = A[r][1]
    i = p - 1
    for j in range(p, r):
        if A[j][1] <= x:
            i = i + 1
            temp = A[i]
            A[i] = A[j]
            A[j] = temp
    temp = A[i+1]
    A[i+1] = A[r]
    A[r] = temp
    return i+1


def quickSort(A, p, r):
    if p < r:
        q = partition(A, p, r)
        quickSort(A, p, q-1)
        quickSort(A, q+1, r)


def isStable(A):
    for i in range(0, len(A)-1):
        if A[i][1] == A[i+1][1]:
            if A[i][2] > A[i+1][2]:
                return False
    return True

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    B = []
    for i in range(n):
        c = sys.stdin.readline().split()
        B.append([c[0], int(c[1]), i])
    quickSort(B, 0, n-1)
    if isStable(B):
        print("Stable")
    else:
        print("Not stable")
    for b in B:
        print(b[0], b[1])

Measured memory_bytes: 24812
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(v) v.begin(), v.end()
#define ll long long
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;

//snippets:tmp,cl,cvl,cs,co,coy,con,cov

int main(){
    ll n;
    cin >> n;
    queue<ll> q;
    queue<ll> qq;
    vll d(500000,0);
    rep(i,n){
        ll a;
        cin >> a;
        if(a>200000) continue;
        q.push(a+i);
        if(a>i) continue;
        d[i-a]++;
    }
    ll count=0;
    ll a=q.size();
    rep(i,a){
        count+=d[q.front()];
        q.pop();
    }
    cout<<count<<endl;
}

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

int main() {
    string line;
    while (getline(cin, line)){
        if (line.size() == 1 && line[0] == '0') {
            break;
        }
        int cards[11] = {};
        while (line.empty() == false) {
            size_t erase = 2;
            if (line.size() == 1 || line[1] == ' ') {
                cards[line[0] - '0']++;
            } else {
                cards[10]++;
                erase = 3;
            }
            line.erase(0, erase);
        }
        int result = 0;
        for (int i = 1; i < 11; i++) {
            result += i * cards[i];
        }
        while (cards[1] > 0) {
            if (result < 12) {
                result += 10;
                cards[1]--;
            } else {
                break;
            }
        }
        if (result > 21) {
            result = 0;
        }
        cout << result << endl;
    }
}

Measured memory_bytes: 0
#ifdef _DEBUG
#define _CRT_SECURE_NO_WARNINGS
#define REL
#endif
#include <algorithm>
#include <string>
#include <iostream>
#include <complex>
#include <ctime>
#include <cmath>
#include <cstdio>
#include <stack>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <random>
#include <set>
#include <vector>
#include <unordered_map>
#include <bitset>
#include <unordered_set>
#include <array>
#include <forward_list>
#include <chrono>
#include <iomanip>
#include <utility>
#include <assert.h>

//#pragma GCC optimize("Ofast")
//#pragma target("sse", "sse1")

#define mp make_pair
#define pb push_back

#define endl '\n'

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

mt19937 gen(34);
//mt19937_64 gen(41);


int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//----------------------------------------------//
	ll k;
	cin >> k;
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a.begin(), a.end());
	a.push_back(a.front());
	ll res = k + 10;
	for (int i = 0; i < n; i++) {
		res = min(res, k - (a[i + 1] - a[i] + k) % k);
	}
	cout << res;
	//----------------------------------------------//

	return 0;
}




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

using namespace std;
constexpr int NMAX = 2005;

int freetop[NMAX][NMAX], freeright[NMAX][NMAX], freeleft[NMAX][NMAX], freebot[NMAX][NMAX];

char grid[NMAX][NMAX];

int main() {
	int h, w; scanf("%d %d", &h, &w);
	for (int i = 0; i < h; ++i) scanf("%s", grid[i]);
	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			if (grid[i][j] == '.') {
				freetop[i][j] = 1 + (i > 0 ? freetop[i-1][j] : 0);
				freeleft[i][j] = 1 + (j > 0 ? freeleft[i][j-1] : 0);
			}
		}
	}
	for (int i = h - 1; i >= 0; --i) {
		for (int j = w - 1; j >= 0; --j) {
			if (grid[i][j] == '.') {
				freebot[i][j] = 1 + (i < h - 1 ? freebot[i+1][j] : 0);
				freeright[i][j] = 1 + (j < w - 1 ? freeright[i][j + 1] : 0);
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			ans = max(ans, freetop[i][j] + freebot[i][j] + freeleft[i][j] + freeright[i][j] - 3);
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 66944
#include <bits/stdc++.h>
#include<math.h>
#include <iostream>
#include <vector>
#include <queue>

using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)


int main() {
  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 ans=a.at(0).at(0);
  rep(i,N){
    ans+=a.at(1).at(i);
  }
  int an=ans;
  rep(i,N-1){    
    ans=max(ans,an-a.at(1).at(i)+a.at(0).at(i+1));
    an=an-a.at(1).at(i)+a.at(0).at(i+1);
  }
  
  cout<<ans<<endl;
  
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 200000
int main(){

  int i,j,R[N],n,maxv=0,minv;

  scanf("%d",&n);

  for(j=0;j<n;j++) scanf("%d",&R[j]);

  minv = R[0];
  maxv = R[1] - R[0];
  for(j=1;j<n;j++){
    if( maxv < R[j]-minv ) maxv = R[j] - minv;
    else maxv = maxv;
    if( minv < R[j] ) minv = minv;
    else minv = R[j];
  }

  printf("%d\n",maxv);
  return 0;
}

Measured memory_bytes: 1380
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int a,b;

int main(){
	cin>>a>>b;
	cout<<(3*a+b)/2<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using VVV = vector<VV>;
using VVVll = vector<VVll>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for (int i = (m); i < (n); ++i)
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) (a).begin(), (a).end()
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline int sz(T &x) { return x.size(); }
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ", " << p.second << ')'; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int fLog2(const int x) { return 31-__builtin_clz(x); } // floor(log2(x))
inline int fLog2(const ll x) { return 63-__builtin_clzll(x); }
inline int cLog2(const int x) { return (x == 1) ? 0 : 32-__builtin_clz(x-1); } // ceil(log2(x))
inline int cLog2(const ll x) { return (x == 1) ? 0 : 64-__builtin_clzll(x-1); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const ld PI    = acos(-1.0);
// const int MOD  = int(1e9)+7;
// const int MOD  = 998244353;


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

  Vll cnt(n+1);

  rep2(x, 1, 101) rep2(y, 1, 101) rep2(z, 1, 101) {
    ll a = 0;
    a += x*x;
    if (a > n) continue;
    a += y*y;
    if (a > n) continue;
    a += z*z;
    if (a > n) continue;
    a += x*y;
    if (a > n) continue;
    a += y*z;
    if (a > n) continue;
    a += z*x;
    if (a > n) continue;
    ++cnt[a];
  }


  rep(i, n) cout << cnt[i+1] << '\n';
  return 0;
}


Measured memory_bytes: 3572
#include <iostream>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <iomanip>
#include <vector>
#include <functional>
#include <algorithm>
#include <cstdio>
#include <random>
#include <ctime>
#include <cstdlib>
#include <unordered_map>
#include <string.h>
#include <iostream>

using namespace std;
typedef long long ll;
typedef pair<int, int> Pint;
typedef pair<ll, ll> Pll;
#define rep(begin, i, end) for (ll i = begin; i < (ll)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    string s, t;
    cin >> s >> t;
    sort(all(s));
    sort(all(t));
    reverse(all(t));
    if (s < t)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#define int long long 
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
int p[114514];
signed main() {
	int n, a, b, cnt = 0;
	cin >> n >> a >> b;
	rep(i, n)cin >> p[i];
	for (int i = 0; i < n - 1; i++)cnt += min(b, (p[i + 1] - p[i]) * a);
	cout << cnt << endl;
	getchar(); getchar(); return 0;
}

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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos,par[ohara],ran[ohara];
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=true;
struct edge{int to,cost;};

void init(int nn) {
	for (int i=0; i<nn; i++) {
		par[i] = i;
		ran[i] = 0;
	}
}//初期化

ll root(ll xx){
    if(par[xx]==xx){
        return xx;
    }
    else{
        return par[xx]=root(par[xx]);
    }
}
//木の根を求めている。
 
bool same(ll xx,ll yy){
    return root(xx)==root(yy);
}
//同じ集合？？
 
void unite(ll xx,ll yy){
    xx=root(xx);
    yy=root(yy);
    if(xx==yy)return;
    
    if(ran[xx]<ran[yy]){
        par[xx]=yy;
    }
    else{
        par[yy]=xx;
        if(ran[xx]==ran[yy])ran[xx]++;
    }
}
//xとyの属する集合を併合
 
//-------------------------↓↓↓↓↓↓------------------------

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

      map<ll,ll> mp;
      map<ll,ll> mpp;

       cin >> n >> m;
     init(n);
      rep(i,m){
          cin >> a >> b;
          unite(a,b);
          mpp[root(a)]++;
      }
      
      rep(i,n){
        mp[root(i+1)]++;
      }

       cmp=mp[root(1)];
      cmpp=mp[root(2)];
      cmp=max(cmp,cmpp);

      rep(i,n){
        pos=mp[root(i+1)];
        if(root(i+1)!=root(1)&&root(i+1)!=root(2))cnt++;
        else{
        mp[root(i+1)]=0;
        rrep(i,1,pos){
          ans+=i;
        }
       // Cout(ans);
        }
        //ans-=mpp[root(i+1)];
        //mpp[root(i+1)]=0;
       // Cout(ans);
        //cout<<"-----------------------\n";
      }
      rrep(i,1,cnt){
        ans+=i;
      }
      

      ans+=cmp*cnt;
     Cout(ans-m);
      
     

       
return 0;
}


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

using namespace std;

/**templates**/
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;

#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define sull(x) scanf("%llu",&x)
#define sf(x) scanf("%lf",&x)
#define ss(x) scanf(" %s",x)
#define sc(x) scanf(" %c",&x)
#define pi acos(-1.0)
#define pb push_back
#define aa first
#define bb second
#define sz(x) (ll)(x).size()
#define cas printf("Case %lld: ",++t)
#define casline printf("Case %lld:\n",++t)
//#define cas cout<<"Case "<<++t<<": "
//#define casline cout<<"Case "<<++t<<":"<<endl;
#define distance(x1,y1,x2,y2)((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
#define endl "\n"
#define bug cout<<"bugggggggggggg "<<endl;
#define fast ios_base::sync_with_stdio(0);cin.tie(nullptr); ///no printf/scanf
#define clean fflush(stdout)

const ll mod = 1000000007;
const ll inf = 1LL<<62;
const ll mx = 100005;
const double eps = 1e-10;

ll dx[10]={1,0,-1,0};
ll dy[10]={0,-1,0,1};
///ll dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; /// 8 Direction
///ll dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; /// Knight Direction

ll power(ll a,ll b)
{
    if(b==0)return 1;
    ll x=power(a,b/2);
    x=x*x;
    if(b%2)x=x*a;
    return x;
}

ll bigmod(ll a,ll b)
{
    if(b==0)return 1;
    ll x=bigmod(a,b/2)%mod;
    x=(x*x)%mod;
    if(b%2)x=(x*a)%mod;
    return x;
}

ll Set(ll N,ll pos){return N=N | (1LL<<pos);}
ll reset(ll N,ll pos){return N= N & ~(1LL<<pos);}
bool check(ll N,ll pos){return (bool)(N & (1LL<<pos));}

/**
        ...ENDING OF TEMPLATE...
*/

int main()
{
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
//    fast; ///no printf/scanf
    /** Use "long double"(%Lf) instead of double for precision safety*/
    ll tst,a,b,c,k,n,m,ans=0,t=0;
    double num;
    sl(a),sf(num);
    b=num*100 + eps;
    ll res = (a*b)/100;
//    cout<<a<<" "<<b<<" "<<res<<endl;
    cout<<res<<endl;



    return 0;
}


Measured memory_bytes: 3824
n=int(input())
r=range(1,100)
l=[0]*n
for x in r:
  for y in r:
    for z in r:
      t=x*x+y*y+z*z+y*z+z*x+x*y-1
      if t<n: l[t]+=1
for i in l: print(i)

Measured memory_bytes: 9284
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#define MIN -1000000
using namespace std;
typedef long long ll;
typedef pair <int, int> pll;
bool visited[100005];
const int max_N = 1e5 + 10;
int N;
int H;
ll a[100005];
ll b[100005];
ll A, B;
vector<pll> swords;
vector<pll> swords2;

int main(void) {
	cin >> N >> H;
	for (int i = 0; i < N; i++) {
		cin >> A >> B;
		swords.push_back(pll(A, B));
		swords2.push_back(pll(B, A));
	}
	

	sort(swords.begin(), swords.end(), greater<pll>());
	sort(swords2.begin(), swords2.end(),greater<pll>());

	int count = 0;

	for (int i = 0; i<N ;i++) {
		if (swords2[i].first < swords[0].first) {
			H = H - swords[0].first;
			count++;
		}
		else {
			H = H - swords2[i].first;
			count++;
		}

		if (H <= 0) {
			cout << count << endl;
			return 0;
		}
	}

	int X = H / swords[0].first;

	H = H - X*swords[0].first;
	count = count + X;

	if (H > 0) count++;


	cout << count << endl;
	return 0;
}

Measured memory_bytes: 2036
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>

#define CH(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);a<=i;i--)

using namespace std;

int main() {

  while(1){
    int N, M, h[1505], w[1505];
    long long ans = 0;
    cin>>N>>M;
    if(N==0 && M==0) break;
    REP(i,0,N) cin>>h[i];
    REP(i,0,M) cin>>w[i];

    vector<long long> hv;
    REP(i,0,N){
      long long hrange = 0;
      REP(j,i,N){
        hrange += h[j];
        hv.push_back(hrange);
      }
    }

    set<long long> ws;
    map<long long , long long> wm;
    REP(i,0,M){
      long long wrange = 0;
      REP(j,i,M){
        wrange += w[j];
        if(ws.find(wrange) == ws.end()) {
          ws.insert(wrange);
          wm[wrange] = 1;
        }else wm[wrange]++;

      }
    }

    REP(i,0,hv.size()){
      if(ws.find(hv[i]) != ws.end()){
        ans += wm[hv[i]];
      }
    }

    cout<<ans<<endl;
  }

  return 0;
}

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

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

    if (a >= 13) {
        cout << b;
    } else if (12 >= a && a >= 6) {
        cout << b / 2;
    } else {
        cout << 0;
    }

    return 0;
}

Measured memory_bytes: 384
// https://atcoder.jp/contests/yahoo-procon2019-qual/tasks/yahoo_procon2019_qual_c
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <set>
#include <unordered_set>
#include <bitset>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define REP(i, n) for(size_t i = 0; i < (n); ++i)

int main()
{
    ll K, A, B;
    cin >> K >> A >> B;
    // A + 2  回の操作でビスケットをお金に変換し、お金をビスケットB枚に変換する
    // A + 2 枚とB枚のどちらが得かで分岐
    if (B - A - 2 > 0)
    {
        ll q = max(0LL, (K - (A - 1)) / 2);
        if (q == 0)
        {
            cout << K + 1 << endl;
            return 0;
        }
        else
        {
            ll ans = (q - 1) * (B - A) + B + (K - (A - 1)) % 2;
            cout << ans << endl;
            return 0;
        }
        
    }
    else
    {
        cout << K + 1 << endl;
        return 0;
    }
    
    return 0;
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const int MOD = 1000000007;

int main() {
  string s;
  cin >> s;
  bool f1 = s.front() == s.back();
  bool f2 = s.size() % 2;
  cout << (f1 ^ f2 ? "First" : "Second") << endl;
}


Measured memory_bytes: 512
N = gets.to_i
A = gets.split.map(&:to_i).sort

odds = A.select(&:odd?)
evens = A.select(&:even?)

def f(n)
  b = 2

  while b <= n
    b *= 2
  end

  b - n
end

def c(list)
  cnt = 0

  counter = Hash.new(0)
  list.each do |l|
    counter[l] += 1
  end

  until list.empty?
    n = list.pop
    next if counter[n] <= 0
    counter[n] -= 1
    t = f(n)
    r = list.bsearch { |x| x >= t }

    if r && r == t && counter[r] > 0
      counter[r] -= 1
      cnt += 1
    end
  end

  cnt
end

puts c(odds) + c(evens)


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

int solve(vector<int> v, const vector<int> P) {
	int cnt = 0;
	while (v != P) {
		next_permutation(v.begin(), v.end());
		cnt++;
	}
	return cnt;
}

int main() {
	int N;
	cin >> N;
	vector<int> P(N), Q(N);
	rep(i, N) {
		cin >> P.at(i);
	}
	rep(i, N) {
		cin >> Q.at(i);
	}
	vector<int> v(N);
	rep(i, N)v.at(i) = i + 1;

	cout << abs(solve(v, P) - solve(v, Q)) << endl;
}


Measured memory_bytes: 3636
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main(){
    let s = read_vec::<i64>();
    let ans1 = s.iter().filter(|&x| *x == 7).count() == 1;
    let ans2 = s.iter().filter(|&x| *x == 5).count() == 2;
    println!("{}",if ans1 && ans2  {
        "YES"
    } else { "NO"});
}

Measured memory_bytes: 4352