akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, -1, 0, 1 , 1,  1, -1, -1 };

int n;
string mcxi1, mcxi2;

int to_int( string str ) {
	int res = 0;
	int many = 1;
	string s = "ixcm";
	for ( int i = 0; i < str.size(); i++ ) {
		if ( str[ i ] >= '2' && str[ i ] <= '9' ) {
			many *= str[ i ] - '0';
		}
		else {
			for ( int j = 0; j < 4; j++ ) {
				if ( str[ i ] == s[ j ] ) {
					for ( int k = 0; k < j; k++ ) {
						many *= 10;
					}
					res += many;
					many = 1;
					break;
				}
			}
		}
	}
	return res;
}


int main() {
	scanf( "%d", &n );
	for ( int i = 0; i < n; i++ ) {
		cin >> mcxi1 >> mcxi2;
		int a = to_int( ( string ) mcxi1 );
		int b = to_int( ( string ) mcxi2 );

		a += b;
		int d = a;
		string res;
		char s[ 9 ];
		int now = 0;
		if ( d / 1000 != 0 ) {
			if ( d / 1000 != 1 ) {
				s[ now ] = ( d / 1000 ) + '0';
				now++;

			}
			s[ now ] = 'm';
			now++;
			d %= 1000;
		}
		if ( d / 100 != 0 ) {
			if ( d / 100 != 1 ) {
				s[ now ] = ( d / 100 ) + '0';
				now++;

			}
			s[ now ] = 'c';
			now++;
			d %= 100;
		}
		if ( d / 10 != 0 ) {
			if ( d / 10 != 1 ) {
				s[ now ] = ( d / 10 ) + '0';
				now++;

			}
			s[ now ] = 'x';
			now++;
			d %= 10;
		}
		if ( d != 0 ) {
			if ( d != 1 ) {
				s[ now ] = d + '0';
				now++;

			}
			s[ now ] = 'i';
			now++;
		}
		s[ now ] = 0;
		res = ( string ) s;
		cout <<  res << "\n";

		
	}
	return 0;
}

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

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] str = in.nextLine().toCharArray();
        Arrays.sort(str);
        if("abc".equals(String.valueOf(str))) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 21972
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Solve.Answer();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
            }
        }
    }

    static class Solve
    {
        public static void Answer()
        {
            var N = IO_ShortCut.ReadInt;
            var S = ReadLine();
            long RCount = S.Where(c => c.Equals('R')).Count();
            long GCount = S.Where(c => c.Equals('G')).Count();
            long BCount = S.Where(c => c.Equals('B')).Count();

            long Cmb = RCount * GCount * BCount;

            for (int i = 0; i < N; i++)
            {
                for (int j = 1; j <= N; j++)
                {
                    if (i - j < 0) break;
                    if (i + j > N - 1) break;

                    if (S[i] != S[i - j] && S[i] != S[i + j] && S[i - j] != S[i + j])
                        Cmb--;
                }
            }
            WriteLine(Cmb);
        }
    }

    static class IO_ShortCut
    {
        #region Input
        public static string ReadString => ReadLine();
        public static int ReadInt => int.Parse(ReadLine());
        public static long ReadLong => long.Parse(ReadLine());
        public static double ReadDouble => double.Parse(ReadLine());

        public static List<string> ReadSplitString => ReadLine().Split().ToList();
        public static List<int> ReadSplitInt => ReadLine().Split().Select(s => int.Parse(s)).ToList();
        public static List<long> ReadSplitLong => ReadLine().Split().Select(s => long.Parse(s)).ToList();
        public static List<double> ReadSplitdouble => ReadLine().Split().Select(s => double.Parse(s)).ToList();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        #endregion
    }
}

Measured memory_bytes: 18860
/*
	Name:
	Author: xiaruize
	Date:
*/

#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD 1000000007
#define ALL(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define form(i,j,n) for(int i=int(j);i<=int(n);i++)
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pis pair<int,string>
#define sec second

inline int read()
{
    char ch=getchar();
    int x=0,f=1;
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar();
    return x*f;
}

queue<char> f,t;

int main()
{
 	ios::sync_with_stdio(false);
	cin.tie(0);
 	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	string s;
	cin>>s;
	int q;
	cin>>q;
	int cnt=0;
	int a;
	int b;
	while(q--)
	{
		cin>>a;
		if(a==1)
		{
			cnt++;
		}
		else if(a==2)
		{
			int k;
			char c;
			cin>>k>>c;
			k+=cnt;
			k%=2;
			if(k==1){
				f.push(c);
			}
			else{
				t.push(c);
			}
		}
	}
	cnt%=2;
	if(cnt==1)
	{
		reverse(ALL(s));
		string ans="";
		while(!t.empty())
		{
			ans+=t.front();
			t.pop();
		}
		reverse(ALL(ans));
		cout<<ans;
		cout<<s;
		while(!f.empty())
		{
			cout<<f.front();
			f.pop();
		}
	}
	else
	{
		string ans="";
		while(!f.empty())
		{
			ans+=f.front();
			f.pop();
		}
		reverse(ALL(ans));
		cout<<ans;
		cout<<s;
		while(!t.empty())
		{
			cout<<t.front();
			t.pop();
		}
	}
	
	return 0;
}

Measured memory_bytes: 1108
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#define oo 987654321
using namespace std;
string a[330];
int h, w, ans, dt[330][330], dt2[330][330];

int dp2(int k, int x, int y)
{
    if( x == h or y == h ) return 0;
    if( ~dt2[x][y] ) return dt2[x][y];
    int &ret = dt2[x][y];
    return ret = dp2(k, x+1, y+1) + (bool)(a[h-x-1][k]==a[h-y-1][k+1]);
}

int dp(int k, int x, int y)
{
    if( x > h or y > h ) return oo;
    if( x == h and y == h ) return 0;
    if( ~dt[x][y] ) return dt[x][y];
    int &ret = dt[x][y];
    ret = min(dp(k, x+1, y), dp(k, x, y+1)) + dp2(k, x, y);
    return ret;
}
void print(int x, int y)
{
    if( x == h or y == h ) return;
    printf("%d %d %d(%d)\n", x, y, dt[x][y], dt2[x][y]);
    if( dt[x+1][y] < dt[x][y+1] ) print(x+1, y);
    else print(x, y+1);
}
int main()
{
    cin>>h>>w;
    for(int i = 0 ; i < h ; i++ ) cin>>a[i];
    for(int x = 0 ; x < w-1 ; x++ )
    {
        for(int i = 0 ; i <= h ; i++ ) for(int j = 0 ; j <= h ; j++ )
            dt[i][j] = dt2[i][j] = -1;
        ans += dp(x, 0, 0);
    }
    cout<<ans<<endl;
    //print(0, 0);
    return 0;
}

Measured memory_bytes: 1280
#include <iostream>

using namespace std;

int main(){
	int h, w;

	while(1){
		cin >> h >> w;

		if(h==0 && w==0){
			break;
		}

		for(int i=0; i<h; i++){
			for(int j=0; j<w; j++){
				cout << '#' ;
			}
			cout << endl;
		}

		cout << endl;
	}
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------
ll gcd( ll m, ll n)
{
    ll l;
    // 引数に０がある場合は０を返す
    if ( ( 0 == m ) || ( 0 == n ) )
            return 0;
    
    // ユークリッドの方法
    while(1)
    {
        l = m % n;
        if(l==0) break;
        m = n;
        n = l;
    }
    return n;
}
ll lcm(ll m, ll n){
    ll g = gcd(m, n);
    if(g == 0){
        return 0;    
    }
    return m*n / g;
}

void solve() {
    ll i,j,k,r,x,y; string S,T;
    bool exit = false;
    ll N,M;
    cin>>N>>M;
    cin>>S>>T;
    ll g = gcd(M,N);
    ll L = lcm(M,N);
    ll l = L / g;
    FOR(i,g){
        if(S[i*(N/g)]!=T[i*(M/g)]){
            cout<< "-1" <<endl;
            return;
        }
    }
    cout<< L <<endl;
    /*cin>>N;
    vector<ll> V((N+1)*(N+1));
    FOR(x,N+1) {
            FOR(y,N+1) {
                    ll ret=1;
                    FOR(i,x) ret*=2;
                    FOR(i,y) ret*=5;
                    V.push_back(ret);
            }
    }
    sort(ALL(V));
    FORR(v,V) cout<<v<<endl;*/
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}



Measured memory_bytes: 640
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<deque>
#include<map>
#include<queue>
using namespace std;
#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 pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
static const ll maxLL = (ll)1 << 62;
const int mod=1000000007;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};



//#define int ll
signed main(){
    int a[3],ans=0;
    string s;cin>>s;
    rep(i,0,3){
        if(s[i]=='1')ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 764
package main

import (
  "fmt"
)

func main() {
  var n, m int 
  fmt.Scan(&n, &m)
  res := make([]int, n)
  for i := 0; i < m; i++ {
    var a, b int 
    fmt.Scan(&a, &b)
    a--; b--
    res[a]++; res[b]++
  }
  for i := 0; i < n; i++ {
    fmt.Println(res[i])
  }
}

Measured memory_bytes: 512
using System;
class Program
 {
   static void Main(string[] args)
   {
     int n;
     long add = 0;
     n = int.Parse(Console.ReadLine());
     string[] str = Console.ReadLine().Split(' ');

    
     
     for(int i = 0 ; i < str.Length ; i++)
     {
       add += int.Parse(str[i]);
     }

     add -= n;

     
     Console.WriteLine(add);
    }
 }

Measured memory_bytes: 13212
#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int a, b, c; cin >> a >> b >> c;

	cout << c - min(a-b, c) << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
using ll = long long;
 
int main() {
	int n;
	cin >> n;
	ll sum = 0;
	for (int i=1;i <=n;i++) {
		if ((i % 3 == 0) && (i % 5) == 0) {
			continue;
		}
		if ( i % 3 == 0) continue;
		if ( i % 5 == 0) continue;
		sum += i;
	}
	cout << sum << endl;
	return 0;
}


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

using namespace std;

int main()
{
    int k;
    vector <int> antennas(5);
    for (int i = 0; i < 5; i++){
        cin >> antennas.at(i);
    }
    cin >> k;
    int length = antennas.at(4) - antennas.at(0);
    if (length <= k){
        cout << "Yay!" << endl;
    }else{
        cout << ":(" << endl;
    }
}

Measured memory_bytes: 256
n, w = map(int, input().split())
items = [list(map(int, input().split())) for _ in range(n)]
max_w = w + 1

dp = [[float('inf')] * max_w for _ in range(n)]

for sum_w in range(max_w):
    if sum_w + items[0][0] < max_w:
        dp[0][sum_w] = items[0][1]
    else:
        dp[0][sum_w] = 0

for i in range(1, n):
    for sum_w in range(max_w):
        if sum_w + items[i][0] < max_w:
            v_0 = dp[i-1][sum_w + items[i][0]] + items[i][1]
            v_1 = dp[i-1][sum_w]
            dp[i][sum_w] = max(v_0, v_1)
        else:
            dp[i][sum_w] = dp[i-1][sum_w]
print(dp[n-1][0])

Measured memory_bytes: 310720
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <unordered_map> 
#include <unordered_set>

using namespace std;

typedef pair<long long int, long long int> P;
typedef tuple<int, int, int> T;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

map<long long int, int> m;

int main(){
    int N;
    cin >> N;
    for(int i = 0; i < (1 << N); i++){
        long long int num;
        cin >> num;
        m[-num] += 1;
    }
    priority_queue<int> que;
    que.push(N);
    for(auto p : m){
        int cnt = p.second;
        if(cnt > que.size()){
            cout << "No" << endl;
            return 0;
        }
        vector<long long int> v;
        for(int i = 0; i < cnt; i++){
            int num = que.top();
            que.pop();
            for(int j = 0; j < num; j++){
                v.push_back(j);
            }
        }
        for(int num : v){
            que.push(num);
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 17280
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	s, _ := reader.ReadString('\n')
	s = strings.TrimSpace(s)

	t, _ := reader.ReadString('\n')
	t = strings.TrimSpace(t)

	substring := t[:len(t)-1]

	if !strings.Contains(s, t) {
		if substring == s {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 1756
import java.io.*;
import java.util.*;

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        char[] s = in.ns().toCharArray();
        int n = s.length, p = 2019;
        int[] m = new int[p]; long ans = 0;
        if(p==2||p==5) {
            for (int i = 0; i < n; i++) {
                if((s[i]-'0')%p==0) ans += i+1;
            }
        }else {
            int u = 0;
            long dig = 1;
            m[0] = 1;
            for (int i = n-1; i >= 0; i--) {
                u += (s[i]-'0')*dig;
                u %= p;
                ans += m[u];
                m[u]++;
                dig *= 10;
                dig %= p;
            }
        }
        out.println(ans);
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}

Measured memory_bytes: 36784
//#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define pb push_back
#define F first
#define S second
#define lll long long
#define lld long double

#define data etokek

//#define int lll

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree <T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

mt19937 gen(chrono::system_clock::now().time_since_epoch().count());

const int N = 2.5e5 + 32;
//const int M = 1e9 + 7;
const int mod = 998244353;
const int rx[4] = {-1, -1, 1, 1};
const int ry[4] = {-1, 1, -1, 1};
const lld eps = 1e-11;
const double pi = acos(-1.0);
const int kx[8] = {1, 1, -1, -1, 2, 2, -2, -2};
const int ky[8] = {2, -2, 2, -2, 1, -1, 1, -1};

main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    srand(time(0));
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
//    freopen("mushrooms.in", "r", stdin);
//    freopen("mushrooms.out", "w", stdout);
#endif
    int n, m;
    cin >> n >> m;
    int x, s = 0;
    for (int i = 0; i < m; ++i) {
        cin >> x;
        s += x;
    }
    if (s > n) {
        cout << -1;
    } else {
        cout << n - s;
    }
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pcc pair<char,char>
#define vi vector <int>
#define vl vector <ll>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d",x)
#define plld(x) printf("%lld",x)
#define pds(x) printf("%d ",x)
#define pllds(x) printf("%lld ",x)
#define pdn(x) printf("%d\n",x)
#define plldn(x) printf("%lld\n",x)
#define INF 2e9
#define INFLL 4e18
using namespace std;
ll powmod(ll base,ll exponent,ll mod){ // with mod < 1e9
	ll ans=1;
	while(exponent){
		if(exponent&1)ans=(ans*base)%mod;
		base=(base*base)%mod;
		exponent/=2;
	}
	return ans;
}
ll gcd(ll a, ll b){
	if(b==0) return a;
	else return gcd(b,a%b);
}
const int upperlimit = 1e6+1;
const int mod = 1e9+7;
int ans[upperlimit];
int main() {
	int n,x,y;
	sd(n);sd(x);sd(y);
	for(int i = 1; i <= n; i++){
		for(int j = i+1; j <= n; j++){
			int gg=min(abs(i-j),min(abs(i-x)+abs(j-y),abs(j-x)+abs(i-y))+1);
			ans[gg]++;
		}
	}
	for(int i = 1; i < n; i++) pdn(ans[i]);
	return 0;
}

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

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

  int x = 1;
  for(int i = 0; i < d; i++) x *= 100;

  if(n < 100) cout << x*n << endl;

  else cout << x*101 << endl;

  return 0;

}


Measured memory_bytes: 256
#include <stdio.h>
int area(int d){
    int s, x;
    s=0;
    x=d;
    while(x<600){
        s+=d*x*x;
        x+=d;
    }
    return s;
}

int main(void){
    int d;
    while(scanf("%d", &d)!=EOF) {
        printf("%d\n", area(d));
    }
    return 0;
}



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

ll dp[110][100010];

int main(int argc, char **argv)
{
	ll N, W; cin >> N >> W;
	vector<ll> value(N), weight(N);
	for (ll i = 0; i < N; ++i) cin >> weight[i] >> value[i];

	for (ll i = 0; i < N; ++i)
	{
		for (ll w = 0; w <= W; ++w)
		{
			dp[i+1][w] = max(dp[i+1][w], dp[i][w]);
			if (w-weight[i]>=0)dp[i+1][w] = max(dp[i+1][w], dp[i][w-weight[i]]+value[i]);
		}
	}

	std::cout << dp[N][W] << std::endl;
}

Measured memory_bytes: 79360
import java.util.*;

public class Main{
    
    int h,w;
    int[][] board;
    int sx,sy,gx,gy;
    int[] dx = {0,1,0,-1};
    int[] dy = {-1,0,1,0};
    
    void solve(){
        Scanner sc = new Scanner(System.in);
        
        while(true){
            h = sc.nextInt();
            w = sc.nextInt();
            if(h==0 && w==0) break;
            
            board = new int[h][w];
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    board[i][j] = sc.nextInt();
                }
            }
            
            sy = sc.nextInt(); sx = sc.nextInt();
            gy = sc.nextInt(); gx = sc.nextInt();
            
            System.out.println(getMin());
        }
    }
    
    int getMin(){
        //x,y,up,south,east,penalty
        PriorityQueue<int[]> 
            q = new PriorityQueue<int[]>(20,new Comparator<int[]>(){
                    public int compare(int[] a, int[] b){
                        return a[5] - b[5];
                    }
                });
        q.add(new int[]{sx,sy,1,2,3,0});
        boolean[][][][][] v = new boolean[h][w][7][7][7];
        
        while(q.size()>0){
            int[] qq = q.poll();
            int x = qq[0], y = qq[1], 
                up = qq[2], south = qq[3], east = qq[4], pena = qq[5];
            
            if(v[y][x][up][south][east]) continue;
            v[y][x][up][south][east] = true;
            
            if(x==gx && y==gy) return pena;
            
            for(int i=0; i<4; i++){
                int nx = x+dx[i], ny = y+dy[i];
                if(nx>=0 && nx<w && ny>=0 && ny<h){
                    int[] dice = getDice(up,south,east,i);
                    //System.out.println("dice "+Arrays.toString(dice));
                    q.add(new int[]{nx,ny,dice[0],dice[1],dice[2],
                                    pena+(7-dice[0])*board[ny][nx]});
                }
            }
        }
        
        return -1;
    }
    
    int[] getDice(int up, int south, int east, int direc){
        int newUp = 0, newSouth = 0, newEast = 0;
        if(direc==0){
            newUp = south;
            newSouth = 7-up;
            newEast = east;
        }else if(direc==1){
            newUp = 7-east;
            newSouth = south;
            newEast = up;
        }else if(direc==2){
            newUp = 7-south;
            newSouth = up;
            newEast = east;
        }else{
            newUp = east;
            newSouth = south;
            newEast = 7-up;
        }
        
        return new int[]{newUp,newSouth,newEast};
    }
    
    public static void main(String[] args){
        new Main().solve();
    }
}

Measured memory_bytes: 16000
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
typedef unsigned long long ull;
typedef long double ldouble;
const ll INF=1e18;
#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++)
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; }
const int mod = 1e9+7;

// N種類の品物があり、i番目の品物はai個ある。異なる種類の品物同士は区別することができるが、
// 同じ種類の商品は区別できない。これらの商品の中からm個選ぶ組み合わせの総数を求める。
// 重複なく数え上げるには同じ種類の品物を一度に処理すれば良さそう。
// dp[i+1][j] = i番目までの品物からj個選ぶ組み合わせの総数

//　素因数分解
map< ll, ll> prime_factorize(ll prime) {
    map< ll, ll> res;
    if(prime == 1) return res;
    ll a = 2;
    while( a*a <= prime){
        if(prime % a == 0){
            ++res[a];
            prime /= a;
        }
        else ++a;
    }
    ++res[prime];
    return res;
}

// 重複組み合わせ
ll nHm (ll n, ll m){
    vector<vector<ll> > dp(n+1, vector<ll>(m+1));
    // 1つも選ばない方法は常に1通り
    rep(i, n+1){
        dp[i][0] = 1;
    }
    rep(i, n){
        rep2(j,1, m+1){
            dp[i+1][j] = (dp[i+1][j-1] + dp[i][j])%mod;
        }
    }
    return dp[n][m] % mod;
}

int main(){
    ll n, m;
    cin >> n >> m;
    map<ll, ll> primes = prime_factorize(m);
    ll answer = 1;
    for(auto prime: primes){
        answer *= nHm(n, prime.second);
        answer %= mod;
    }
    cout << answer % mod << endl;
}

Measured memory_bytes: 30616
#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#include<functional>
#include<math.h>
#include<unordered_set>
using namespace std;

const int MAX = 101;
const int INF = 1 << 30;

const int dx[] = { 0,1,0,-1 };
const int dy[] = { 1,0,-1,0 };

int main() {
	int W, H;
	int whiteNum = 0;
	char grid[MAX][MAX];
	int dp[MAX][MAX];
	queue<pair<int, pair<int, int>>> q;

	cin >> H >> W;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cin >> grid[i][j];
			dp[i][j] = INF;
			if (grid[i][j] == '.')whiteNum++;
		}
	}

	q.push(make_pair(0, make_pair(0, 0)));
	dp[0][0] = 0;

	while (!q.empty()) {
		int c = q.front().first;
		int x = q.front().second.first;
		int y = q.front().second.second;
		q.pop();

		for (int i = 0; i < 4; i++) {
			int nx = x + dx[i];
			int ny = y + dy[i];

			if (nx < 0 || ny < 0 || nx >= W || ny >= H)continue;
			if (grid[ny][nx] == '#')continue;
			if (c + 1 >= dp[ny][nx])continue;

			q.push(make_pair(c + 1, make_pair(nx, ny)));
			dp[ny][nx] = c + 1;
		}
	}

	if (dp[H - 1][W - 1] == INF)cout << -1 << endl;
	else cout << whiteNum - dp[H - 1][W - 1] - 1<< endl;

	return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
#pragma warning(disable : 4996)
using namespace std;
int N, M, a, b, ret; vector<int> G[11];
void solve(int pos, int bit) {
	if (bit == (1 << N) - 1) {
		ret++;
		return;
	}
	for (int i : G[pos]) {
		if (!(bit & (1 << i))) {
			solve(i, bit + (1 << i));
		}
	}
}
int main() {
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		cin >> a >> b; a--, b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	solve(0, 1);
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

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

    public static void main(String[]$) {
        final long INF = 1L << 50;

        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] a = new int[m];
        int[] b = new int[m];
        long[] c = new long[m];
        for (int i = 0; i < m; i++) {
            a[i] = scanner.nextInt() - 1;
            b[i] = scanner.nextInt() - 1;
            c[i] = -scanner.nextInt();
        }
        long[] dist = new long[n];
        Arrays.fill(dist, 1, dist.length, INF);

        for (int i = 1; i < n; i++)
            for (int j = 0; j < m; j++)
                if (dist[a[j]] != INF)
                    dist[b[j]] = Math.min(dist[b[j]], dist[a[j]] + c[j]);

        long ans = -dist[n - 1];
        boolean[] neg = new boolean[n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (dist[a[j]] == INF) {
                    continue;
                }
                if (dist[b[j]] > dist[a[j]] + c[j]) {
                    dist[b[j]] = dist[a[j]] + c[j];
                    neg[b[j]] = true;
                }
                if (neg[a[j]]) {
                    neg[b[j]] = true;
                }
            }
        }

        System.out.println(neg[n - 1] ? "inf" : ans);
    }
}

Measured memory_bytes: 28480
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, k, n) for(int i = (k); i < (int)(n); i++)
using namespace std;
int main(){
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    int L = A + B;
    int R = C + D;
    if(L == R)
        cout << "Balanced" << endl;
    else if(L > R)
        cout << "Left" << endl;
    else
        cout << "Right" << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <utility>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long int ll;

int main() {
  int N;
  cin>>N;
  
  vector<int> A(N);
  vector<int> ans(N);
  rep(i,N){
    cin>>A[i];
    ans[A[i]-1]=i+1;
  }
  
  rep(i,N){
    cout<<ans[i]<<endl;
  }
}


Measured memory_bytes: 1664
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <array>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional> // greater など
#include <cmath>      // abs など
#include <numeric>    // accumulate, gcd など
#include <cassert>    // assert
#include <stdexcept>
#include <bitset>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

// GCC, 配列のアクセスなど
#define _GLIBCXX_DEBUG
// Clang, 配列のアクセスなど
#define _LIBCPP_DEBUG 0

//////////////// //////////////// //////////////// //////////////// ////////////////
//////////////// //////////////// //////////////// //////////////// ////////////////

// constexpr inline ll mod = 1'000'000'007;
// constexpr int max_n = 200'000 + 5;
map<string,string> m = { {"ABC", "ARC"}, {"ARC", "ABC"} };

int main()
{
    // 高速な入出力
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << setprecision(15); // 浮動小数の表示の精度

    string s; cin>>s;
    cout << m[s] << '\n';

    return 0;
}


Measured memory_bytes: 3584
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int elements = sc.nextInt()-1;
        int[] value = new int[elements];
        for (int i = 0; i < elements; i++) {
            value[i] = sc.nextInt();
        }
        solve(value);
    }

    public static void solve(int[] value){
        int result = value[0] + value[value.length-1];
        for(int i=1; i<value.length; i++){
            result += Math.min(value[i-1],value[i]);
        }
        System.out.println(result);
    }
}

Measured memory_bytes: 21844
x, y, a, b, c = gets.split.map(&:to_i)
ps = gets.split.map(&:to_i).max(x)
qs = gets.split.map(&:to_i).max(y)
rs = gets.split.map(&:to_i).sort!.reverse!

pqs = [*ps, *qs].sort!
ans = pqs.inject(:+)

[pqs.count, rs.count].min.times do |i|
  ans += rs[i] - pqs[i] if rs[i] >= pqs[i]
end
puts ans


Measured memory_bytes: 27256
#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int (i)=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1'000'000'007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }

int main(){
    int N;
    string S;
    cin >> N >> S;
    string T;
    for(int i=0; i<S.size(); i++){
        T += 'A' + ((S[i] - 'A') + N)%26;
    }
    cout << T << endl;
    return 0;
}

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

int main(){

	int X;
	cin >> X;

	int Day = X % 7;

	if( Day == 0 ) cout << "thu" << endl;
	else if( Day == 1 ) cout << "fri" << endl;
	else if( Day == 2 ) cout << "sat" << endl;
	else if( Day == 3 ) cout << "sun" << endl;
	else if( Day == 4 ) cout << "mon" << endl;
	else if( Day == 5 ) cout << "tue" << endl;
	else cout << "wed" << endl;

	return 0;
}


Measured memory_bytes: 3124
#include <iostream>
using namespace std;
const int N=1e4+5;
int ans[N];
int main(){
    for(int x=1;x<100;x++){
        int x2=x*x;
        for(int y=1;y<100;y++){
            int x2y2=x2+y*y+x*y;
            if(x2y2>=N) break;
            for(int z=1;z<100;z++){
                int res=x2y2+(x+y+z)*z;
                if(res<N){
                    ++ans[res];
                }
                else break;
            }
        }
    }
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        cout<<ans[i]<<"\n";
    }

    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
// const ll MOD = 1e9 + 7;
const ll MOD = 998244353;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll n,m;

bool dfs(vector<vector<ll> >& G,vector<ll>& c,int now,int t){
	if(c[now] != -1){
		if(c[now] != t)return false;
		return true;
	}
	c[now] = t;

	bool res = true;
	rep(i,G[now].size()){
		ll to = G[now][i];
		res &= dfs(G,c,to,((t == 0) ? 1 : 0));
	}
	return res;
}

int main(){
	while(cin >> n >> m && n+m){
		vector<V> G(n,V());
		vector<ll> c(n,-1);
		rep(i,m){
			ll a,b;
			cin >> a >> b;
			a--; b--;
			G[a].push_back(b);
			G[b].push_back(a);
		}
		if(!dfs(G,c,0,0)){
			cout << 0 << endl;
			continue;
		}
		ll cnt = 0;
		rep(i,n)cnt += c[i];
		set<ll> sl;
		if(cnt % 2 == 0)sl.insert(cnt / 2);
		if((n-cnt) % 2 == 0)sl.insert((n-cnt) / 2);
		cout << sl.size() << endl;
		for(set<ll>::iterator it = sl.begin();it != sl.end();it++){
			cout << *it << endl;
		}
	}
}


Measured memory_bytes: 3248
# include<iostream>
# include<iomanip>

using namespace std;

int main() 
{
  int a, b;
  int d, r;
  double f;

  cin >> a >> b;

  d = a / b;
  r = a % b;
  f = (double)a/b;
  cout << d << " " << r << " " << fixed << f << endl;

  return 0;
}

Measured memory_bytes: 1252
void main() {
	auto ip = readAs!(int[]), N = ip[0], M = ip[1];
	auto roads = new int[](N);
	foreach(_; 0..M) {
		auto ip2 = readAs!(int[]), a = ip2[0], b = ip2[1];
		roads[--a]++;
		roads[--b]++;
	}

	roads.each!writeln;	
}

// ===================================

import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a[200007];
  long long int sum=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
    for(int k=0;k<n-1;k++){
      if(a[k]>a[k+1]){
        sum+=(a[k]-a[k+1]);
        a[k+1]=a[k];
      }
  	}
  cout<<sum<<endl;
}

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


int main(){
    int N, K;
    cin >> N >> K;
    vector<int> x(N);
    for(int i=0; i<N; i++) cin >> x[i];
    
    int mi=1e9;
    for(int i=0; (i+K-1)<N; i++){
        int sum1=1e9, sum2=1e9;
        if(x[i]<=0 && x[i+K-1]>=0){
            sum1 = abs(x[i])*2+abs(x[i+K-1]);
            sum2 = abs(x[i+K-1]*2)+abs(x[i]);
        }
        else if(x[i]<=0 && x[i+K-1]<=0){
            sum1 = abs(x[i]);
        }
        else if(x[i]>=0 && x[i+K-1]>=0){
            sum1 = abs(x[i+K-1]);
        }
        mi = min(mi, min(sum1,sum2));
    }
    cout << mi << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
struct go {
	int x,y,magic;
	bool operator < (const go &l) const{
		return magic>l.magic;
	}
};
priority_queue<go> q;
int h,w,ans=-1;
int ch,cw,dh,dw;
char s[1100][1100];
bool vis[1100][1100];
int fx[]={1,0,-1,0};
int fy[]={0,1,0,-1};
int main() {
	memset(vis,0,sizeof(vis));
	cin>>h>>w;
	cin>>ch>>cw;
	cin>>dh>>dw;
	for(int i=1;i<=h;i++)
		for(int j=1;j<=w;j++)
			cin>>s[i][j];
	q.push((go){ch,cw,0});
	while(!q.empty()) {
		go x=q.top();q.pop();
		if(x.x==dh && x.y==dw) {
			ans=x.magic;
			break;
		}
		if(vis[x.x][x.y]) continue; 
		for(int i=0;i<4;i++) {
			int tx=x.x+fx[i],ty=x.y+fy[i];
			if(tx<1 || ty<1 || tx>h || ty>w) continue;
			if(vis[tx][ty]==0 && s[tx][ty]=='.') 
				q.push((go){tx,ty,x.magic}); 
		}
		vis[x.x][x.y]=1;
		for(int i=max(1,x.x-2);i<=min(h,x.x+2);i++)
			for(int j=max(1,x.y-2);j<=min(w,x.y+2);j++) {
				if(vis[i][j]==0 && s[i][j]=='.') 
					q.push((go){i,j,x.magic+1});
			}
	}
	printf("%d",ans);
	return 0;
}


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

int main(void){
  unsigned long long int n, b ,r;
  cin >> n >> b >> r;
  if(b == 0){
    cout << "0";
    return 0;
  }
  unsigned long long int ans = (n/(b+r))*b;
  unsigned long long int add = n % (b+r);
  if(add > b){
    add = b;
  }
  cout << ans + add;
  return 0;
}


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

int main(void){
  int n,r;
  cin>>n>>r;
  int internal_rate=0;
  
  if(n<10){
    internal_rate=r+100*(10-n);
  }else{
    internal_rate=r;
  }
  
  cout<<internal_rate<<endl;
  
  return 0;
}

Measured memory_bytes: 888
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<list>
using namespace std;
int main() {
	int n; cin >> n;
	vector<int>v(n);
	vector<bool>f(n);

	for (int i = 0; i < n; i++) {
		cin >> v[i];
		f[i] = false;
	}
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		if (v[v[i] - 1] == i + 1 && f[i] == false && f[v[i] - 1] == false) {
			cnt++;
			f[i] = f[v[i] - 1] = true;
		}
	}
		cout << cnt << endl;


		return 0;

	

}

Measured memory_bytes: 640
using AtCoderBeginnerContest149.Questions;
using AtCoderBeginnerContest149.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace AtCoderBeginnerContest149.Questions
{
    public class QuestionA : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            yield return string.Concat(inputStream.ReadLine().Split(' ').Reverse());
        }
    }
}


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

#region Base Classes

namespace AtCoderBeginnerContest149.Questions
{

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

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

            return Solve(reader);
        }

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

}

#endregion

#region Extensions

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

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

#endregion

Measured memory_bytes: 11220
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#define MOD 998244353LL

using namespace std;
typedef long long int ll;

int main()
{
	int n;
	int x[200], y[200];
	scanf("%d", &n);
	for(int i=0; i<n; i++){
		scanf("%d %d", &x[i], &y[i]);
	}
	vector<int> v[200][200];
	int t[200];
	for(int i=0; i<n; i++){
		t[i]=0;
		set<int> st;
		for(int j=0; j<n; j++){
			if(j!=i) st.insert(j);
		}
		for(int j=0; j<n; j++){
			if(st.find(j)==st.end()) continue;
			st.erase(j);
			v[i][t[i]].push_back(i);
			v[i][t[i]].push_back(j);
			for(int k=j+1; k<n; k++){
				if(st.find(k)==st.end()) continue;
				if((x[j]-x[i])*(y[k]-y[i])==(x[k]-x[i])*(y[j]-y[i])){
					v[i][t[i]].push_back(k);
					st.erase(k);
				}
			}
			t[i]++;
		}
	}
	multiset<int> c;
	for(int i=0; i<n; i++){
		for(int j=0; j<t[i]; j++){
			int m=v[i][j].size();
			c.insert(m);
		}
	}
	ll ans=1;
	for(int i=0; i<n; i++){
		ans=ans*2%MOD;
	}
	ans=(ans-(ll)(n*(n+1)/2+1)+MOD)%MOD;
	for(int i=3; i<=n; i++){
		int m=c.count(i);
		m/=i;
		ll ans1=1;
		for(int j=0; j<i; j++){
			ans1=ans1*2%MOD;
		}
		ans1=(ans1-(ll)(i*(i+1)/2+1)+MOD)%MOD;
		ans1=ans1*(ll)m%MOD;
		ans=(ans-ans1+MOD)%MOD;
	}
	printf("%lld\n", ans);
	return 0;
}

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

using namespace std;

struct pos
{
    int x, y;
};

pos arr[100010];
int par[100010];

int root(int x)
{
    return x == par[x] ? x : (par[x] = root(par[x]));
}

bool merge(int x, int y)
{
    x = root(x);
    y = root(y);
    if(x == y)
        return 0;
    par[x] = y;
    return 1;
}

struct edg
{
    int x, y, w;
    edg(int x, int y) : x(x), y(y)
    {
        w = min(abs(arr[x].x - arr[y].x), abs(arr[x].y - arr[y].y));
    }
    bool operator <(const edg &a) const
    {
        return w < a.w;
    }
};

int main()
{
    int n, i;
    scanf("%d", &n);
    for(i = 0; i < n; i++)
        scanf("%d%d", &arr[i].x, &arr[i].y);

    for(i = 0; i < n; i++)
        par[i] = i;

    vector<pair<int, int>> vx, vy;
    for(i = 0; i < n; i++)
        vx.push_back({ arr[i].x, i });
    for(i = 0; i < n; i++)
        vy.push_back({ arr[i].y, i });

    sort(vx.begin(), vx.end());
    sort(vy.begin(), vy.end());

    vector<edg> v;
    for(i = 0; i < (int)vx.size() - 1; i++)
        v.push_back(edg(vx[i].second, vx[i + 1].second));
    for(i = 0; i < (int)vy.size() - 1; i++)
        v.push_back(edg(vy[i].second, vy[i + 1].second));

    sort(v.begin(), v.end());
    long long r = 0;
    for(auto e : v)
        if(merge(e.x, e.y))
            r += e.w;

    printf("%lld\n", r);
    return 0;
}

Measured memory_bytes: 8304
// DP F

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#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())
using namespace std;

typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1e9;
const long long INFL = 1LL<<60;

void dump(const vector<pair<int, int>>& a)
{
  for (auto v : a) {
    cerr << v.first << " " << v.second << endl;
  }
}

////////////////////////////////////////////////////

static const int MAX = 100000;
bool V[MAX];
list<int> out;
vector<int> G[MAX];
int N;
int indeg[MAX];

void bfs(int s)
{
  queue<int> q;
  q.push(s);
  V[s] = true;
  while (!q.empty()) {
    int u = q.front(); q.pop();
    out.push_back(u);
    rep(i, G[u].size()) {
      int v = G[u][i];
      indeg[v]--;
      if (indeg[v] == 0 && !V[v]) {
        V[v] = true;
        q.push(v);
      }
    }
  }
}

void topologicalSort()
{
  rep(i, N) {
    indeg[i] = 0;
  }

  rep(u, N) {
    rep(i, G[u].size()) {
      int v = G[u][i];
      indeg[v]++;
    }
  }

  rep(u, N) {
    if (indeg[u] == 0 && !V[u]) {
      bfs(u);
    }
  }

  for (auto it = out.begin(); it != out.end(); it++) {
    cout << *it << endl;
  }
}

int main()
{
  int s, t, M;
  cin >> N >> M;
  rep(i, N) {
    V[i] = false;
  }
  rep(i, M) {
    cin >> s >> t;
    G[s].push_back(t);
  }
  topologicalSort();
  return 0;
}



Measured memory_bytes: 6244
n, m, l = gets.chomp.split(/\s+/).map(&:to_i)

arr = []
brr = []

n.times do 
  arr << gets.chomp.split(/\s+/).map(&:to_i).to_a
end
m.times do 
  brr << gets.chomp.split(/\s+/).map(&:to_i).to_a
end

require 'matrix'

crr = Matrix[*arr] * Matrix[*brr]

crr.to_a.each {|r| puts r.join(" ")}


Measured memory_bytes: 7548