akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {
	
    private static Scanner sc;

    public static void main(String[] args) {
        Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private void solve() {
        try {
        	int a = sc.nextInt();
        	int b = sc.nextInt();
        	
        	int sum = a > b ? a-- : b--;
        	sum += a > b ? a-- : b--;
        	
            System.out.println(sum);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null) br.close();
        }

        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String st = br.readLine();
            while (st == "") st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }
}


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

#define nl '\n'

using namespace std;

typedef long long ll;

void solve() {
  int N;
  cin >> N;
  int A[N];
  for (int& i : A)
    cin >> i;

  ll height = 0;
  for (int i = 0, maxheight = 0; i < N; i++) {
    maxheight = max(maxheight, A[i]);
    height += maxheight - A[i];
  }

  cout << height;
}

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

  // int t;
  // cin >> t;
  // while (t--) {
  solve();
  // }

  return 0;
}

Measured memory_bytes: 4444
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1e9+7;
const LL LINF=1LL<<62;

int main(){
    int N;
    cin >> N;
    vector<LL> A;
    for(int i=0;i<N;i++){
        LL a;
        cin >> a;
        A.pb(a);
    }
    int count=0;
    for(int i=0;i<N;i++){
        if(A[i]>count){
            puts("-1");
            return 0;
        }
        if(A[i]==0) count=0;
        count++;
    }
    for(int i=0;i<N-1;i++){
        if(A[i]<A[i+1]-1){
            puts("-1");
            return 0;
        }
    }
    LL ans=0;
    for(int i=0;i<N-1;i++){
        if(A[i]+1==A[i+1]) continue;
        else ans+=A[i];
    }
    ans+=A[N-1];
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s;
    int k;
    cin >> s >> k;
    int n = sz(s);
    vvi idx(26);
    for (char c = 'a'; c <= 'z'; ++c) rep(i, n) if (s[i] == c) idx[c - 'a'].pb(i);
    for (char c = 'a'; c <= 'z'; ++c) {
        set<string> st;
        for (int i : idx[c - 'a']) {
            for (int j = i; j < min(i+5, n); ++j) {
                st.insert(s.substr(i, j - i + 1));
            }
        }
        if (sz(st) >= k) {
            for (string ans : st) {
                k--;
                if (k == 0) {
                    cout << ans << endl;
                    return 0;
                }
            }
        } else {
            k -= sz(st);
        }
    }
}

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

using namespace std;

const int N = (int) 1e6 + 6;

vector<int> d[N];
int cnt[N];

void precalc() {
  for (int i = 1; i < N; i++) {
    for (int j = i; j < N; j += i) {
      d[j].push_back(i);
    }
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  precalc();
  int n;
  cin >> n;
  int g = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    for (int j : d[x]) {
      ++cnt[j];
      if (j != 1 && cnt[j] >= 2) {
        break;
      }
    }
    g = __gcd(g, x);
  }
  bool found = false;
  for (int i = 2; i < N; i++) {
    if (cnt[i] >= 2) {
      found = true;
      break;
    }
  }
  if (!found) {
    cout << "pairwise coprime" << endl;
  } else if (g == 1) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  return 0;
}


Measured memory_bytes: 121708
#include <bits/stdc++.h>
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.14159265
#define MOD 1000000007
#define PSET(x,y) fixed<<setprecision(y)<<x
#define ll long long
#define ld long double
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define lop(i,a,b) for(ll i=a;i<b;i++)
#define lopr(i,a,b) for(ll i=a;i>=b;i--)
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define fi first
#define se second
#define pi pair<int,int>
#define pll pair<ll, ll>
#define si set<int>
#define sll set<ll>
#define maxheap priority_queue<int>
#define minheap priority_queue<int,vector<int>,greater<int>>
#define state tuple<int,int,int>

inline int sbt(int x){return __builtin_popcount(x);} //returns number of set bits

using namespace std;

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

int n;
int a[105];


int rec(int s, int e){

	int ans=0;

	int idx = min_element(a+s,a+e+1)-a;
	int min = a[idx];
	ans += min;
	
	// deb(s,e,min);

	bool all_zero=true;
	lop(i,s,e+1){
		a[i] -= min;

		if(a[i]!=0)
			all_zero=false;
	}
	
	if(all_zero){
		// deb(ans);
		return ans;
	}

	bool flag=false;
	int prev_idx=s;
	lop(i,s,e+1){
		if(a[i]==0){
			if(i==s){
				prev_idx=s+1;
			}
			else{
				ans += rec(prev_idx,i-1);
				prev_idx=i+1;

				if(i==e)
					flag=true;
			}
		}
	}

	if(!flag)
		ans += rec(prev_idx,e);

	// deb(ans);
	return ans;
}

int main(){
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //     freopen("output.txt", "w", stdout);
    // #endif
    
    fast_io()
        
    cin>>n;
    
    lop(i,0,n) cin>>a[i];

    cout<<rec(0,n-1);

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int n;
	char s[n];
	int counter=0;
	scanf("%d",&n);
	scanf("%s",&s);
	for(int i=0,j=n/2;i<n;i++,j++){
	if(s[i]==s[j]){
			counter++;
		}
	}
	
	if(n%2==0 && counter==n/2){
		printf("Yes\n");
	}
		
	else{
		printf("No\n");
	}
	
	return 0;
}

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

namespace AtCoder_20190707_1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int count = 0;

            for(int i = 1; i <= n; i++)
            {
                if(i.ToString().Length % 2 == 1)
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0))
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0))
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a))
#define RSort(a) reverse(All(Sort(a)))
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
using namespace std;
int max_int = 1000000007;
void Debug(auto a);
int nibutan(auto a,auto b);
class Modulo{
public:
    int val;
    static const int mod = 1e9+7;
    vector<int> factable = {1};
    vector<int> invtable = {1};
    int pro(int x,int y){return ((x%mod)*(y%mod))%mod;}
    int sum(int x,int y){return ((x%mod)+(y%mod))%mod;}
    int dif(int x,int y){int d =((x%mod)-(y%mod))%mod;if(d>=0){return d;}else{return d+mod;}}
    int quo(int x, int y){return pro(x,pow(y,mod-2));}
    int pow(int x,int y){
        if(y<=0){return 1;}
        if(y%2==0){int d = pow(x,y/2);return ((d%mod)*(d%mod))%mod;}
        else{return (x*pow(x,y-1))%mod;}
    }
    void operator=(int n){this->val = n%mod;}
    int operator+(int n){return sum(this->val,n);}
    int operator-(int n){return dif(this->val,n);}
    int operator*(int n){return pro(this->val,n);}
    int operator/(int n){return quo(this->val,n);}
    void operator+=(int n){this->val = sum(this->val,n);}
    void operator-=(int n){this->val = dif(this->val,n);}
    void operator*=(int n){this->val = pro(this->val,n);}
    void operator/=(int n){this->val = quo(this->val,n);}
    int fac(int x){
        //x! mod mod
        if(factable.size()<=x){
            int s = factable.size();
            FOR(i,s,x+1){
                factable.push_back(pro(i,factable.back()));
                invtable.push_back(quo(1,factable.back()));
            }
        }
        if(x<0) return 1;
        else return factable[x];
    }
    int facinv(int x){
        if(invtable.size()<=x){
            int s = invtable.size();
            FOR(i,s,x+1){
                factable.push_back(pro(i,factable.back()));
                invtable.push_back(quo(1,factable.back()));
            }
        }
        if(x<0) return 1;
        else return invtable[x];
    }
    int com(int x,int y){
        //xCy mod mod = x!/((x-y)!*y!) mod mod
        if(x-y<y)return com(x,x-y);
        return pro(fac(x),pro(facinv(x-y),facinv(y)));
    }
};


signed main(){
    int n,m;
    cin >> n >> m;
    int ren = m*1900 + (n-m)*100;
    REP(i,m){
        ren *= 2;
    }
    cout << ren << endl;


    return 0;
}

void Debug(auto a){
    cout << "{ ";
    for(auto b: a){
        cout << b << " ";
    }
    cout << "}" << endl;
}
int nibutan(auto a,auto b){
    int x = lower_bound(All(a),b) - a.begin();
    return x-1;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};


int main() {
    ll D;
    cin >> D;
    vl c(26);
    rep(i,26){
        cin >> c[i];
    }
    ll s[D][26];
    rep(i,D){
        rep(j,26){
            cin >> s[i][j];
        }
    }
    vl latest_t(26,0);
    ll k=0;
    FOR(i,1,D+1){
        ll t;
        cin >> t;
        t--;
        latest_t[t]=i;
        k+=s[-1+i][t];
        rep(j,26){
            k-=c[j]*(i-latest_t[j]);
        }
        cout << k << endl;
    }
}

Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long int a;
    cin>>a;
    string s;
    cin>>s;
    long long int b = (s[0]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0');
    long long int res = (a*b)/100;
    cout<<res<<"\n";
    
}


Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	private static final long MOD = (long)Math.pow(10, 9) + 7;
	public static void main(String[] args) {
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		int x = sc.nextInt();
		int min = Integer.MAX_VALUE;
		int res = 0;
		
		for (int i = 0; i < n; i++) {
			int material = sc.nextInt();
			x -= material;
			min = Math.min(material, min);
			res++;
		}
		res += (x / min);
		System.out.println(res);
	}
	
	private static int findNiconicoLevel(String s) {
		int res = 0;
		String prev = "";
		int pos = 1;
		int level = 0;
		while (pos < s.length()) {
			String curr = "" + s.charAt(pos - 1) + s.charAt(pos);
			if (curr.equals("25")) {
				if (prev.equals("25")) {
					level += 2;
				} else {
					prev = "25";
					level = 2;
				}
				res = Math.max(res, level);
				pos += 2;
			} else {
				level = 0;
				prev = "";
				pos++;
			}
		}
		
		return res;
	}
	
	private static String nTimesChar(char c, int t) {
		String res = "";
		for (int i = 0; i < t; i++) {
			res += c;
		}
		return res;
	}
	
	static class FastReader {
	    BufferedReader br;
	    StringTokenizer st;
	
	    public FastReader() {
	      br = new BufferedReader(new InputStreamReader(System.in));
	    }
	  
	    String next() { 
	      while (st == null || !st.hasMoreElements()) {
	        try {
	          st = new StringTokenizer(br.readLine());
	        } catch (IOException  e) {
	          e.printStackTrace();
	        }
	      }
	      return st.nextToken();
	    }
	
	    int nextInt() {
	      return Integer.parseInt(next());
	    }
	
	    long nextLong() {
	      return Long.parseLong(next());
	    }
	
	    double nextDouble() { 
	      return Double.parseDouble(next());
	    }
	
	    String nextLine() {
	      String str = "";
	        try{
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
	      }
	  }
}


Measured memory_bytes: 21460
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <functional>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}
ll kai(ll x, ll y, ll m) {
	ll res = 1;
	for (ll i = x - y + 1; i <= x; i++) {
		res *= i; res %= m;
	}
	return res;
}
ll mod_pow(ll x, ll y, ll m) {
	ll res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

ll comb(ll x, ll y, ll m) {
	if (y > x)return 0;
	return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

string s;
int ans;

signed main() {
	std::random_device rnd;
	std::mt19937_64 mt(rnd());
	cin >> s;
	int cnt = 0;
	for (int i = 0; i < 3; i++) {
		if (s[i] == 'R')cnt++;
		else cnt = 0;
		ans = max(ans, cnt);
	}
	cout << ans << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll          long long
#define pb          push_back
#define mp 	    make_pair
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define fi          first
#define si          second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define mod        1000000007
#define mset(m,v) memset(m,v,sizeof(m))
using namespace std;
ll power(ll a , ll b,ll modi)
{
    a%=modi;
    ll res = 1 ;
    while(b)
    {
        if(b%2) {
            res = (res * a) % modi ;
        }
        b/=2 ;
        a = (a*a) % modi ;
    }
    return res ;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t=1;
	//cin>>t;
	while(t--)
	{
	int n,k;
	cin>>n>>k;
	int a[n];
	for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int sum=0;
    for(int i=0;i<k;i++)
        sum+=a[i];
    cout<<sum;
	}
return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;

int main(void)
{
    string s;
    cin >> s;
    int n = s.length();
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = i; j < n; j++)
        {
            bool flag = true;
            for (int k = i; k <= j; k++)
            {
                if (!(s[k] == 'A' || s[k] == 'C' || s[k] == 'G' || s[k] == 'T'))
                {
                    flag = false;
                }
            }
            if (flag)
            {
                ans = max(ans, j - i + 1);
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int l=Integer.parseInt(s.nextLine())+1;
		int x=Integer.parseInt(s.nextLine());
		int[] p = new int[l];
		for(int i=0;i<l;i++)p[i]=i;
		while(x-->0){String str=s.nextLine();int a= Integer.parseInt(str.split(",")[0]);int b= Integer.parseInt(str.split(",")[1]);int t=p[a];p[a]=p[b];p[b]=t;}
		for(int i=1;i<l;i++)System.out.println(p[i]);
	}
}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vd(T) vector<vector<T>>
#define v(T) vector<T>
#define mod (ll)(1e9+7)
#define pp(T) pair<T,T>
#define pb push_back
#define read1(x) scanf("%d",&x)
#define read2(x,y) scanf("%d%d",&x,&y)
#define read3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define read4(a,b,c,d) scanf("%d%d%d%d",&a,&b,&c,&d)
#define mp make_pair
#define NN 100005
#define IO ios_base::sync_with_stdio(NULL),cin.tie(0),cout.tie(0)
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define DEBUG cout<<"***********DEBUGGING***********"<<endl
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; 
ll power(ll a,ll b){ if(b==0) return 1; ll s=power(a,b/2); s*=s;if(b&1) return s*a; return s;}
ll powermod(ll a,ll b,ll m){ if(b==0) return 1; ll s=power(a,b/2);s*=s; s%=m; if(b&1) return (s*a)%m; return s;}
inline int add(ll a,ll b,ll m=0){
    if(m==0) return a+b;
    return (a%m+b%m)%m;
}

inline int sub(ll a,ll b ,ll m=0){
    if(m==0) return a-b;
    return ((a%m-b%m)%m+m)%m;
}

inline int mul(ll a,ll b,ll m=0){
    if(m==0)return (a*b);
    return ((a%m)*(b%m))%m;
}

inline int div(ll a,ll b,ll m=0){
    if(m==0) return a/b;
    return ((a%m)*(powermod(a,b,m-2)%m))%m;
}

bool isopen(char c){
    return ((c=='(')||(c=='{')||(c=='['));
}

ll longest_balanced_parenthesis(string a,ll n){
    stack<char> s;
    ll start=0;
    ll ans=0,m=0;
    for(ll i=0;i<n;i++){
        if(isopen(a[i])){
            s.push(a[i]);
        }
        else{
            if(isopen(a[i])|| s.empty()){
                m=max(m,ans);
                continue;
            }
            else{
                s.pop();
                ans+=2;
                m=max(ans,m);
            }
        }
    }

    return m;

}

ll setup_k(ll *a,ll k){
  ordered_set x;
  // Now , insert and then check number of integers less than k by just using x.order_of_key(k+1)
  return 0;
}

ll nC2(ll n){
    return (n*(n-1))/2;
}

int main() {

    IO; 

    ll n;
    cin>>n;
    map<string,ll> m;
    for(ll i=0;i<n;i++){
        string s;
        cin>>s;
        sort(s.begin(),s.end());
        m[s]++;
    }
    ll ans=0;
    for(auto i: m){
        ans+=nC2(i.second);
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 11264
/** Author : Parth Prajapati
 * 	Institute : Pandit Deendayal Petroleum University
**/
#include<bits/stdc++.h>

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	long long int h,w,n;
	cin>>h>>w>>n;
	if(h > w)	cout<<(n+h-1)/h;
	else		cout<<(n+w-1)/w;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
int main(){
  int n;
  cin>>n;
  vector<int> p(n),a(n),b(n);
  for(int i=0;i<n;i++){
    cin>>p[i];
    a[i]=i*n+1;
    cout<<a[i]<<" ";
  }cout<<endl;
  for(int i=0;i<n;i++){
    b[p[i]-1]=a[n-1]+1+i-a[p[i]-1];
  }
  for(int i=0;i<n;i++)cout<<b[i]<<" ";
}

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

#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);

typedef long long int lli;

int main()
{
    fio;
    lli N,W;
    cin>>N>>W;
    lli w[N+1],v[N+1];
    for(lli i=1;i<=N;i++) cin>>w[i]>>v[i];
    lli dp[N+1][W+1];
    for(int i=0;i<=N;i++)
    {
        for(int j=0;j<=W;j++) dp[i][j] = 0;
    }
    for(lli i=1;i<=N;i++)
    {
        for(lli j=1;j<=W;j++)
        {
            dp[i][j] = dp[i-1][j];
            if(j >= w[i] and v[i] + dp[i-1][j-w[i]] > dp[i][j]) dp[i][j] = v[i] + dp[i-1][j-w[i]];
        }
    }
    cout<<dp[N][W]<<endl;
    cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s" << "\n";
    return 0;
}

Measured memory_bytes: 79232
#include <iostream>

using namespace std;

int main()
{
    string s;
    cin>>s;
    int i=0,j=s.length()-1,c=0;
    while(j>i){
        if(s[j--]!=s[i++]){
            c++;
        }

    }
    cout<<c;
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
public class Main
{
    static PrintWriter out=new PrintWriter((System.out));
    public static void main(String args[])throws IOException
    {
        Reader sc=new Reader();
        String s=sc.next();
        if(s.equals("ABC"))
        {
            out.println("ARC");
        }
        else
        {
            out.println("ABC");
        }
        out.close();
    }

    public static void solve()
    {
    }

    static class Reader 
    { 
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        public String next()
        {
            while(!st.hasMoreTokens())
            {
                try
                {
                    st=new StringTokenizer(br.readLine());
                }
                catch(Exception e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt()
        {
            return Integer.parseInt(next());
        }

        public long nextLong()
        {
            return Long.parseLong(next());
        }

        public double nextDouble()
        {
            return Double.parseDouble(next());
        }

        public String nextLine()
        {
            try
            {
                return br.readLine();
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext()
        {
            String next=null;
            try
            {
                next=br.readLine();
            }
            catch(Exception e)
            {
            }
            if(next==null)
            {
                return false;
            }
            st=new StringTokenizer(next);
            return true;
        }
    } 
}

Measured memory_bytes: 32664
import itertools
N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))
list_a = list(range(1,N+1))
tuple_a = tuple(list_a)
ptr = list(itertools.permutations(tuple_a))
ptr_num = len(list(itertools.permutations(tuple_a)))
for i in range(0,ptr_num):
  if ptr[i] == tuple(P):
    P_num=i+1
  if ptr[i] == tuple(Q):
    Q_num=i+1
print(abs(P_num-Q_num))


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

int main(){
  int n,k; cin >> n >> k;
  map<int,int> snuke;
  for (int i = 0; i < k; i++)
  {
    int d;
    cin >> d;
    for (int j = 0; j < d; j++)
    {
      int tmp;
      cin >> tmp;
      if (!(snuke.count(tmp - 1)))snuke[tmp - 1] = 1;
    }
    
  }
  
  
  int ans = 0;
  for (int i = 0; i < n; i++)
  {
    if(!(snuke.count(i)))ans++;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3628
#include <iostream>
#define int long long int
using namespace std;

int N;

signed main(){
    cin >> N;
    int ans = 0, m;
    for(int i = 1; i * i <= N; i++){
        if(!(N % i) && N/i - 1 > i){
            ans += N/i - 1;
        }
    }
    cout << ans << endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define oo 0x3f3f3f3f
#define ooLL 0x3f3f3f3f3f3f3f3f
#define fastio() ios_base::sync_with_stdio(false); cin.tie(NULL)
const int mod = 1e9+7;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
 
int main(){
    fastio();
    for(int ti = 1; ti <= 1 ; ++ti){
        int k;
        cin >> k;
        string s;
        cin >> s;
        const int N = s.size();
        string ans = s;
        if(N > k) ans = s.substr(0,k) + "...";
        
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3652
N, M = gets.split(' ').map(&:to_i)
store = []
count = 0
cost = 0

N.times do |i|
  store.push(gets.split(' ').map(&:to_i))
end

store = store.sort

store.each do |e|
  break if count == M

  if count + e[1] < M
    cost += e[0] * e[1]
    count += e[1]
  else
    cost += e[0] * (M - count)
    count = M
  end
end

puts cost

Measured memory_bytes: 11128
// https://atcoder.jp/contests/abc168/tasks/abc168_c
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    double A, B, H, M;
    cin >> A >> B >> H >> M;
    double Ax = cos(M_PI * 2 * (3 - H - M / 60) / 12) * A;
    double Ay = sin(M_PI * 2 * (3 - H - M / 60) / 12) * A;
    double Bx = cos(M_PI * 2 * (15 - M) / 60) * B;
    double By = sin(M_PI * 2 * (15 - M) / 60) * B;
    printf("%.10f\n", hypot(Ax - Bx, Ay - By));

    return 0;
}


Measured memory_bytes: 4176
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
	string vals[3] = {"Sunny", "Cloudy", "Rainy"};
	
	string S; cin >> S;
	
	F0R(i, 3) {
		if (S == vals[i]) {
			cout << vals[(i+1)%3] << endl;
		}
	}
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343


Measured memory_bytes: 764
n = int(input())
x = []
for _ in range(n):
  x.append(input().split())
y = sorted(x)

for i in range(n):
  y[i][1] = 100 - int(y[i][1])
y.sort()
for i in range(n):
  y[i][1] = str(100 - y[i][1])
  print(x.index(y[i])+1)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int, int> pi;
const int mod = 1e9 + 9;
const int MAXN = 100005;
 
int n, l;
lint dp[55][2];
 
int main(){
	cin >> n >> l;
	dp[0][0] = 1;
	for(int i=1; i<=n; i++){
		int x;
		cin >> x;
		x %= 2;
		dp[i][0] = dp[i-1][0] + dp[i-1][0 ^ x];
		dp[i][1] = dp[i-1][1] + dp[i-1][1 ^ x];
	}
	cout << dp[n][l] << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define M 2505
#define rint register int
int n,m,p;
int a,b,c;
LL Dis[M];
struct Edge {
	int to,v;
};
bool inQ[M];
int cntTo[M];
vector<Edge>E[M];
vector<int>e[M];
queue<int>Q;
bool Mark[M];
void dfs(int x) {
	Mark[x]=1;
	for(int i=0; i<(int)e[x].size(); ++i)
		if(!Mark[e[x][i]])dfs(e[x][i]);
}
int main() {
	scanf("%d%d%d",&n,&m,&p);
	for(int i=1; i<=m; ++i) {
		scanf("%d%d%d",&a,&b,&c);
		E[a].push_back((Edge)<%b,c-p%>);
		e[b].push_back(a);
	}
	dfs(n);
	for(int i=2; i<=n; ++i)Dis[i]=-1e18;
	Q.push(1);
	bool flag=1;
	while(!Q.empty()) {
		int x=Q.front();
		Q.pop();
		if(++cntTo[x]==n) {
			flag=0;
			break;
		}
		inQ[x]=0;
		for(int i=0; i<(int)E[x].size(); ++i) {
			int u=E[x][i].to,v=E[x][i].v;
			if(!Mark[u])continue;
			if(Dis[u]<Dis[x]+v) {
				Dis[u]=Dis[x]+v;
				if(!inQ[u])Q.push(u),inQ[u]=1;
			}
		}
	}
	printf("%lld",flag?max(0LL,Dis[n]):-1LL);
}

Measured memory_bytes: 640
//118
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<algorithm>
#include<deque>
#include<queue>
#include<set>
#include<map>
#include<functional>

using namespace std;
#define LL long long
#define ALF "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define LLBIG 1999999999999999999LL
#define INTBIG 1111111111
#define MOD 1000000007
#define PI pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>

int H, W, h, w, A, B, C;

int main() {
	cin >> A >> B;
	cout << (B%A ? B-A : B+A) << endl;



	return 0;
}

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

def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

d = divisor(n)

mn = 10 ** 12
for i in d:
    if (n / i) % 1 == 0:
        mn = min(n//i + i, mn)

print(mn-2 if mn != n else mn-1)

Measured memory_bytes: 39664
#include<bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
const lint mod=1e9+7;

int main()
{
  lint x;
  cin >> x;


  std::vector<lint> primes(100003,0);
  primes[0] = 2;
  for(int i=1;i<primes.size();i++){
    primes[i] = primes[i-1] + 1;
  }

  lint cnt=0;
  while(1){
    if(primes[cnt]!=0){
      for(int i=cnt+1;i<primes.size();i++){
        if(primes[i]%primes[cnt]==0){
          primes.erase(primes.begin()+i);
        }
      }
    }
    if(primes[cnt]>=x){
      cout << primes[cnt] << "\n";
      break;
    }
    cnt++;
  }

  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <list>
//#include <cmath>
#include <random>
#include <algorithm>

using std::cout;
using std::cerr;
using std::cin;
using std::endl;

using std::vector;
using std::list;
using std::string;

void funcA()
{
	string S;
	string T;
	cin >> S;
	cin >> T;
	int x = 0;
	if (S[0] == T[0]) {
		x++;
	}
	if (S[1] == T[1]) {
		x++;
	}
	if (S[2] == T[2]) {
		x++;
	}
	cout << x << endl;
}

void func()
{
	int A;
	int B;
	cin >> A;
	cin >> B;
	int C = 1;
	
	int cnt = 0;
	while (C < B) {
		C += (A - 1);
		cnt++;
	}
	cout << cnt << endl;

}

int main() {
	func();

}




Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)

using namespace std;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMod = 1e9 + 7;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

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

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  ll H, W;
  cin >> H >> W;

  if (H == 1 || W == 1) {
    cout << 1 << endl;
    return 0;
  }

  if (H % 2 == 0 || W % 2 == 0) {
    cout << H * W / 2 << endl;
  } else {
    cout << H * W / 2 + 1 << endl;
  }

  return 0;
}


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

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

#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;

int main(){
  int l, r, d;
  cin >> l >> r >> d;
  cout << (r/d)-(l-1)/d << endl;
}

Measured memory_bytes: 3624
#include<iostream>
#include<cstdio>
using namespace std;
char s[150];
char c;
int t=0;
long long k;
int main()
{
    while (1)
    {
        scanf("%c",&c);
        if (c=='\n') break;
        s[t++]=c;
    }
    cin>>k;
    for (int i=0; i<t; ++i)
    {
        if (s[i]=='1')
        {
            k-=1;
            if (k==0)
            {
                cout<<1<<endl;
                break;
            }
        }
        else
        {
            cout<<s[i]<<endl;
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
using namespace std;
#define int long long


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

    string n; cin >> n;

    int ans = 0;
    bool k = 0;

    char c;

    int i = n.size() - 1;
    while(i > 0){
        c = n.at(i);
        if(c - '0' < '9'+1 - c) {
            ans += c - '0';
        }
        else if(c == '5'){
            if(n.at(i-1) < '5'){
                ans += 5;
            }else{
                ans += 5;
                n.at(i-1) ++;
            }
        }
        else {
            ans += '9'+1 - c;
            n.at(i-1) ++;
        }
        i --;
    }

    c = n.at(0);
    if(c - '0' <= '9'+1 - c) ans += c - '0';
    else {
        ans += '9'+1 -c;
        ans += 1;
    }


    cout << ans << endl;
}

Measured memory_bytes: 1948
#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;
    cin >> n;
    int h[n];
    rep(i,n) cin >> h[i];

    int dp[n];
    dp[0] = 0;
    dp[1] = abs(h[1] - h[0]);
    for(int i=2; i<=n-1; i++) {
        dp[i] = min(dp[i-2] + abs(h[i] - h[i-2]),
                    dp[i-1] + abs(h[i] - h[i-1]));
    }
    cout << dp[n-1] << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
using namespace std;
#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define l1 list[index]
#define l2 list[index - 1]
#define l3 list[index + 1]
#define iif(i,j) ((i<0 && j<0) || (i>0 && j>0)) ? true : false 
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };



signed main() {
	int n, k, cnt = 0, pp, h, l;
	string s, s1, s2;
	vector<int>list;
	vector<int>mat(10, 0);
	int sum = 0, maxn = -9999, minn = 199999999999999;

	cin >> n;

	for (int i = 0; i < 5; i++) {
		int num;
		cin >> num;
		list.push_back(num);
		minn = min(minn, num);
	}

/*	int num;

	if (n%minn == 0) {
		num = n / minn + 5;
	}
	else {
		num = n / minn + 5 + 1;

	}
	*/
	
	if (minn >= n) {
		cout << 5 << endl;
		getchar();
		getchar();
		return 0;
	}


	mat[0] = n;

	while (true)
	{
		for (int i = 4; i >= 0; i--) {
			if (mat[i] > 0) {
				if (mat[i] < list[i]) {
					mat[i + 1] += mat[i];
					mat[i] = 0;
				}
				else {
					mat[i + 1] += list[i];
					mat[i] -= list[i];
				}	
			}
		}

		cnt++;

		if (mat[5] >= 1) {
			break;
		}

	}

	int num;
	//int num = n / mat[5] + 5;

	if (n%mat[5] == 0) {
		 num = n / mat[5] + 4;
	}
	else {
		 num = n / mat[5] + 5;
	}
	

	


	cout << num << endl;





	
	getchar();
	getchar();
	return 0;
}

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

#define ll long long
#define rep(i, s, n) for (ll i = s; i < n; i = i + 1)
#define rev(i, s, n) for (int i = s; i > n; i = i - 1)
using namespace std;
#define fr first
#define se second
#define pb push_back
#define mp make_pair
#define mv vector<ll>
#define vii vector<pair<ll, ll>>
// akane_psycho
#define fastio                                                                 \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
#define c1(a) cout << a << endl;
#define c2(a, b) cout << a << " " << b << endl;
#define inf 1e18
#define mod 1000000007
#define ii pair<ll,ll>
#define sw(v)      cout << endl;                                                                \
  for(auto u:v) {cout << u << " ";}                                     \
  cout << endl;
  
  /*
  ll ml(ll a, ll b){
  	return ( (a%mod)*(b%mod) )%mod;
  }
ll fp(ll num,ll g)
{
    if(g==0)return 1;
    if(g%2==1)return ml(num,fp(ml(num,num) ,g/2) );
    return fp( ml(num,num),g/2);
}
ll d(ll a, ll b) {//a/b
	return a*fp(b, mod - 2) % mod;
}
ll pm(ll f[] , ll n, ll r){
	return d(  f[n] , f[n-r] );
}
ll cm(ll f[] , ll n , ll r ){
		return d( f[n] , ml( f[r],f[n-r] ) );
	}
*/

int main(){
	ll k,a,b;cin>>k>>a>>b;
	ll q=a/k;
	if(a%k!=0)q++;
	if( q*k<=b)c1("OK")
	else c1("NG")
}


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

int inf = 1e9;

int main(){
    int N, u, v;
    cin >> N >> u >> v;
    vector<vector<int>> edge(N+1);
    for (int i = 0; i < N-1; i++) {
        int a, b;
        cin >> a >> b;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }
    vector<int> tdist(N+1, inf), adist(N+1, inf);
    tdist[u] = 0;
    adist[v] = 0;
    queue<int> q;
    q.push(u);
    while (!q.empty()) {
        int now = q.front();
        q.pop();
        for (int nxt : edge[now]) {
            if (tdist[nxt] > tdist[now]+1) {
                tdist[nxt] = tdist[now]+1;
                q.push(nxt);
            }
        }
    }
    
    q.push(v);
    while (!q.empty()) {
        int now = q.front();
        q.pop();
        for (int nxt : edge[now]) {
            if (adist[nxt] > adist[now]+1) {
                adist[nxt] = adist[now]+1;
                q.push(nxt);
            }
        }
    }
    
    int ans = 0;
    for (int i = 1; i <= N; i++) {
        if (adist[i] > tdist[i]) {
            ans = max(ans, adist[i]-1);
        }
    }
    cout << ans << endl;
    return 0;
}


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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/
int main() {
  ll n,k,s;
  cin >> n >> k >> s;

  REP(i,k) cout << s << " ";
  REP(i,n-k){
    if(s==1e9) cout << 1 << " ";
    else cout << s+1 << " ";
  }
  cout << endl;

  
  //cout << fixed << setprecision(10);
  return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
long long dp[100][1000];
long long arr[200];
const int MAX = 700;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	for(int i = 0;i <= 81;i++){
		for(int j = 1;j <= 850;j++){
			dp[i][j] = -1;
		}
	}
	int n;
	cin >> n;
	for(int i = 1;i <= n;i++)cin >> arr[i];
	long long money = 1000;
	for(int i = 1;i <= n - 1;i++){
		long long st = 0;
		if(arr[i] < arr[i + 1])st = money / arr[i];
		money += (arr[i + 1] - arr[i]) * st;
	}
	cout << money;
	return 0;
}

Measured memory_bytes: 4260
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <algorithm>

using namespace std;
#define n_max 1000

int main()
{
    int n;
    int p[20];
    int cnt = 0;

    cin >> n;

    for(int i = 0; i < n; i++){
        cin >> p[i];
    }

    for(int i = 0; i < n; i++) {
        if((i + 2 > n - 1) || (i + 1 > n - 1)) { break; }

        //cout << p[i] << " " <<  p[i + 1] << " "   << p[i + 2] << endl;

        if(((p[i] > p[i+1]) && (p[i+1] > p[i+2])) || 
           ((p[i+2] > p[i+1]) && (p[i+1] > p[i]))    ) 
        { 
            cnt++; 
        } 
    }

    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <iterator>
#include <cctype>
#include <cstdio>
#include <cstring>
#define rep(counter, limit) for (int counter = 0; counter < limit; counter++)
typedef long long ll; using namespace std;const int INF=1001001001;
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool primenum(int a) { if (a == 1) { return false; }if (a == 2) { return true; }if (a % 2 == 0) { return false; }for (int i = 3; i < sqrt(a) + 1; i += 2) { if (a != i) { if (a % i == 0) { return false; } } }return true; }
int main() {

  double r;
  cin>>r;
  cout<<(r*2)*3.14<<endl;

}


Measured memory_bytes: 3840
#include <stdio.h>

int main(){
	int flag;
	double xa1,xa2,xb1,xb2,ya1,ya2,yb1,yb2;

	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&xa1,&ya1,&xa2,&ya2,&xb1,&yb1,&xb2,&yb2) != EOF){
		flag = 0;

		if(!(xb1 > xa2 || yb1 > ya2 || xb2 < xa1 || yb2 < ya1)){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}

	return 0;
}

Measured memory_bytes: 608
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<unordered_map>
#include<cmath>
using namespace std;
typedef unsigned long long ll;
ll mod = (10e+8)+ 7;

ll ap[100000];
ll ab[100000];
ll ad[100000];

int main(){
	long N;
	ll ans=0;
	cin>>N;
	string S;
	unordered_map<string,ll>a;

	for(int i = 0; i < N; i++){
		cin>>S;
		
		sort(&S[0],&S[10]);
		
		a[S]++;
		if( a[S] > 1){
			ans+=a[S]-1;
		}
	}

	cout<<ans<<endl;
}

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

typedef long long int llint;

main()
{
    const char paper = 'p', rock = 'g';

    #ifdef ENG
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
    #endif

    string str; cin >> str;

    llint rock_c = 0, paper_c = 0;

    // rock_c >= paper_c

    // llint point = 0;

    string n;

    for (auto &I : str)
    {
        if (I == rock)
        if (rock_c > paper_c)
        {
            paper_c++;
            n.push_back(paper);
        }
        else
        {
            rock_c++;
            n.push_back(rock);
        };
        if (I == paper)
        {
            if (rock_c > paper_c)
            {
                paper_c++;
                n.push_back(paper);
            }
            else
            {
                rock_c++;
                n.push_back(rock);
            }
        }
    };

    llint point = 0;

    for (llint i = 0 ; i <= str.size() - 1 ; i++)
    {
        if (str[i] == n[i]) continue;
        if (str[i] == paper && n[i] == rock) point--;
        else point++;
    };
    cout << point;
    #ifdef ENG
    cout << endl << "target: " << n;
    #endif
}

Measured memory_bytes: 512