akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define int long long
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#define MOD 1000000007

vector<pair<int, int>> vec;
int ze = 0;

int pow_mod(int n, int m){
	int ans = 1;
	while(m > 0){
		if(m & 1) ans = (ans * n) % MOD;
		n = (n * n) % MOD;
		m >>= 1;
	}
	return ans;
}

int memo[200010];

int dp(int i){
	if(memo[i] != -1) return memo[i];
	if(i == vec.size()){
		return memo[i] = 1;
	}
	int ans = dp(i+1);
	if(vec[i].first != 0){
		int tmp = (MOD + pow_mod(2, vec[i].first) - 1) % MOD; 
		ans = (ans + tmp *dp(i+1) % MOD) % MOD;
	}

	if(vec[i].second != 0){
		int tmp = (MOD + pow_mod(2, vec[i].second) - 1) % MOD; 
		ans = (ans + tmp * dp(i+1) % MOD) % MOD;
	}

	return memo[i] = ans;
}

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

	int a[200010];
	int b[200010];
	vector<pair<int, int>> yes, no;
	map<pair<int, int>, int> fu, fu2;
	int owata = 0;
	set<pair<int, int>> st;
	int az, bz;
	az = bz = 0;
	for(int i = 0;i < n;i++){
		cin >> a[i] >> b[i];
		if(a[i] == 0 || b[i] == 0){
			if(a[i] != b[i]){
				if(a[i] == 0) az++;
				else bz++;
			}else{
				owata++;
			}
		}else{
			if((a[i] < 0) != (b[i] < 0)){
				int ap = abs(a[i]);
				int bp = abs(b[i]);
				no.push_back({ap, bp});
				int g = __gcd(ap, bp);
				fu[make_pair(ap/g, bp/g)]++;
				st.insert(make_pair(ap/g, bp/g));
			}else{
				int ap = abs(a[i]);
				int bp = abs(b[i]);
				yes.push_back({ap, bp});
				int g = __gcd(bp, ap);
				fu2[make_pair(bp/g, ap/g)]++;
				st.insert(make_pair(bp/g, ap/g));
			}
		}
	}

	for(auto e : st){
		vec.push_back({fu[e], fu2[e]});
	}
	vec.push_back({az, bz});

	memset(memo, -1, sizeof(memo));
	
	int ans = dp(0);

	ans = (MOD + ans - 1) % MOD;


	ans = (ans + owata) % MOD;
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 60832
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <map>
#include <set>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define sz(x) int(x.size())

typedef long long ll;

using namespace std;

/*******-c++14 don't include-*******/
template<typename T>
T gcd(T a, T b){if( b == 0)return a; return gcd(b, a%b); }
template<typename T>
T lcm(T a, T b){return a*b/gcd(a,b); }
/*******---------------------*******/

static const int INTINF = (2147483647);
static const ll LLINF = (1ll<<32);
static const int MAX = 101;

long long dp[MAX][MAX];

int main(int argc, const char * argv[]) {
    // input from txt
    
    /////////
    //write//
    /////////
    
    int v, e;
    cin >> v >> e;
    //v = 頂点数, e = エッジの数
    
    rep(i, MAX){
        rep(j, MAX){
            dp[i][j] = (i==j)? 0 : LLINF;
        }
    }
    
    rep(i, e){
        int s, t, d;
        cin >> s >> t >> d;
        dp[s][t] = d;
    }
    
    rep(k, v){
        rep(i, v){
            if(dp[i][k] == LLINF)continue;
            rep(j, v){
                if(dp[k][j] == LLINF)continue;
                dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
            }
        }
    }
    
    bool negative = false;
    rep(i, v){
        if(dp[i][i] <0)negative = true;
    }
    
    if(negative){
        cout << "NEGATIVE CYCLE"<< endl;
    }
    else{
        rep(i, v){
            rep(j, v){
                if(j)cout << " ";
                if(dp[i][j] == LLINF)cout << "INF";
                else
                cout << dp[i][j];
            }
            cout << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 3204
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void swap(int *a, int *b)
{
	int temp = *a;
	*a = *b;
	*b = temp;
}

int main()
{
	const int BUFF_SIZE = 100;
	char buff[BUFF_SIZE];
	
	fgets(buff, BUFF_SIZE, stdin);
	int count = atoi(buff);
	
	for (int i = 0; i < count; i++)
	{
		fgets(buff, BUFF_SIZE, stdin);
		int a, b, c;
		sscanf(buff, "%d %d %d", &a, &b, &c);
		
		if (c > b)
		{
			swap(&b, &c);
		}
		if (b > a)
		{
			swap(&a, &b);
		}
		
		int flag = ((a * a) == (b * b + c * c));
		
		printf("%s\n", flag ? "YES" : "NO");
	}
	
	return 0;
}

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

#define REP(i,num) for(ll i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){T x; cin >> x; return (x);}
template<typename T=ll,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

template<typename T>
bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>
bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	auto N=in(),M=in();
	vector<pair<ll,ll>> P(M);
	REP(i,M){
		P[i].first = in();
		int B=in();
		ll X=0;
		REP(j,B){
			int c=in();
			X |= 1ll<<(c-1);
		}
		P[i].second=X;
	}
	int L=1<<N;
	vvll dp(M+1,vll(L,1ll<<60));
	dp[0][0] = 0;

	REP(i,M){
		REP(j,L){
			chmin(dp[i+1][j],dp[i][j]);
			chmin(dp[i+1][j|P[i].second],dp[i][j]+P[i].first);
		}
	}

	out(dp[M][L-1]>=1ll<<60 ? -1 : dp[M][L-1]);
	return 0;
}


Measured memory_bytes: 32384
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
 
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define loop(i, l, r) for(int i = l; i < r; i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vec_i;

const int dx[4] = {0, 0, 1, -1};
const int dy[4] = {1, -1, 0, 0};
const int INF = 1e9;
const int MOD = 1e9+7;

int main()
{
	int n;
	cin >> n;
	vec_i h(n);
	rep(i,n) cin >> h[i];

	vec_i dp(n, INF);
	dp[0] = 0;
	rep(i,n){
		if(i+1 < n){
			int a = h[i],b = h[i+1];
			if(a < b) swap(a,b);
			dp[i+1] = min(dp[i+1], dp[i] + a - b);
		}
		if(i+2 < n){
			int a = h[i],b = h[i+2];
			if(a < b) swap(a,b);
			dp[i+2] = min(dp[i+2], dp[i] + a - b);
		}
	}
	cout << dp[n-1] << endl;
}

Measured memory_bytes: 1024
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x*x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int tb[5][4][11];

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

	for (int i = 0; i < n; i++) {
		int b, f, r, v; cin >> b >> f >> r >> v;

		tb[b][f][r] += v;
	}

	for (int i = 1; i <= 4; i++) {
		for (int j = 1; j <= 3; j++) {
			for (int k = 1; k <= 10; k++) {
				cout << " " << tb[i][j][k];
			}
			cout << endl;
		}

		if (i != 4) {
			for (int k = 0; k < 20; k++)cout << "#";
			cout << endl;
		}
		
	}

}


Measured memory_bytes: 3112
#include<iostream>

using namespace std;

int main() {
	int N, K;

	cin >> N >> K;

	string S;

	cin >> S;

	if (S.at(K-1) == 'A') {
		S.at(K - 1) = 'a';
	}
	if (S.at(K - 1) == 'B') {
		S.at(K - 1) = 'b';
	}
	if (S.at(K - 1) == 'C') {
		S.at(K - 1) = 'c';
	}

	cout << S << endl;
}

Measured memory_bytes: 256
import networkx as nx

int1 = lambda x: int(x) - 1
MOD = 10 ** 9 + 7

N, K = map(int, input().split())

G = nx.Graph()
G.add_nodes_from(range(N))
G.add_edges_from([tuple(map(int1, input().split())) for _ in range(N - 1)])

ans = K
for i in range(nx.degree(G)[0]):
    ans = (ans * (K - i - 1)) % MOD

for parent, child in nx.dfs_edges(G, 0):
    for i in range(nx.degree(G)[child] - 1):
        ans = (ans * (K - i - 2)) % MOD

print(ans)


Measured memory_bytes: 163924
#include <stdio.h>

void print_chessboard(int h, int w);

int main(int argc, char *argv[]){
  int H,W;

  scanf("%d %d", &H, &W);
  while( H!=0 || W!=0 ){
    print_chessboard(H,W);
    printf("\n");
    scanf("%d %d", &H, &W);
  }
  return(0);
}

void print_chessboard(int h, int w){
  int i,j;
  for(i=0; i<h; i++){
    if(i%2==0)
      for(j=0; j<w; j++){
	(j%2==0) ? printf("#") : printf(".");
      }
    else
      for(j=0; j<w; j++){
	(j%2==0) ? printf(".") : printf("#");
      }
    printf("\n");
  }
}



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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}
template<typename T,typename U>
ll FindErase(T &v,U tar){
  ll cnt = 0;
  for(auto it = v.begin(); it != v.end();){
    if(*it == tar){
      it = v.erase(it);
      ++cnt;
    }
    else{
      ++it;
    }
  }
  return cnt;
}

template<typename T>
bool SuffixErase(T &v,size_t suf){
  if(suf > v.size()) return false;
  for(auto it = v.begin(); it != v.end();){
    if(distance(v.begin(),it) == suf){
      v.erase(it);
      return true;
    }
    else{
      ++it;
    }
  }
  return false;
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}
const int arr[] = {5,7,5,7,7};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  while(cin >> n && n){
    string s;
    vector<ll> v(n);
    rep(i,n){
      cin >> s;
      v[i] = s.size();
    }
    rep(i,n){
      int suf = 0,len = 0;
      REP(j,i,n){
        len += v[j];
        if(len == arr[suf]){
          len = 0,++suf;
        }
        else if(len > arr[suf]){
          suf = 0;
          break;
        }
        if(suf == 5){
          break;
        }
      }
      if(suf == 5){
        cout << i+1 << endl;
        break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3156
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<map>
#include<utility>
#include<queue>
#define mod 998244353
#define pb push_back
#define ll long long
using namespace std;
int main(){
	ll a,b,c;
	cin>>a>>b>>c;
	if(a%2 == 0 || b%2==0 || c%2==0){
		cout<<0<<endl;
		return 0;
	}
	else{
		cout<<min(a*b, min(b*c, c*a))<<endl;
		return 0;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }



int N, M;

int main() {
    while (cin >> N >> M) {
        vector<long long> a[3];
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < 3; ++j) {
                long long num; cin >> num;
                a[j].push_back(num);
            }
        }
        long long res = 0;
        for (int bit = 0; bit < (1<<3); ++bit) {
            vector<long long> b;
            for (int i = 0; i < N; ++i) {
                long long tmp = 0;
                for (int j = 0; j < 3; ++j) {
                    if (bit & (1<<j)) tmp += a[j][i];
                    else tmp -= a[j][i];
                }
                b.push_back(tmp);
            }
            sort(b.begin(), b.end(), greater<long long>());
            long long sum = 0;
            for (int i = 0; i < M; ++i) {
                sum += b[i];
            }
            chmax(res, sum);
        }
        cout << res << endl;
    }
    
}



























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

namespace easy_Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nm = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            Console.WriteLine((nm[0]-1)*(nm[1]-1));
        }
            // float[] ABN = Array.ConvertAll(Console.ReadLine().Split(),float.Parse);
            // long[] NK = Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            // long N = NK[0];
            // long K = NK[1];
            // long K = long.Parse(Console.ReadLine());
            // int[] abc = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // string S = Console.ReadLine();
            // int x = int.Parse(Console.ReadLine());
            // int b = int.Parse(Console.ReadLine());
            // int N = int.Parse(Console.ReadLine());
            // float N = float.Parse(Console.ReadLine());
            // string c = Console.ReadLine();
            // string B = Console.ReadLine();
            // string[] s = Console.ReadLine().Split();
            // var s = (new string[] { Console.ReadLine(), Console.ReadLine(), Console.ReadLine() }).Select(float.Parse);
            // float[] a = Array.ConvertAll(Console.ReadLine().Split(),float.Parse);
            // var X = Console.ReadLine();
            // int[,] abcd = new int[NMQ[2],4];
            // int[] A = new int[NMQ[0]];
            // int[] A_num = new int[NMQ[0]];
            // long[] s=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            // var hs=new Dictionary<long,long>();
            // for(int i=0;i<s[0];i++){
            //     long[] q=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            //     if(hs.ContainsKey(q[0])){hs[q[0]]+=q[1];}
            //     else{hs.Add(q[0],q[1]);}
            // }
        
        // //最小公倍数
        // static long Lcm(long a, long b)
        // {
        //     return a/Gcd(a,b)*b;
        // }

        // //最大公約数
        // static long Gcd(long m, long n)
        // {
        //     if(n==0)return m;
        //     return Gcd(n,m%n);
        // }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define pi pair<int,int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define mod 998244353
#define inf 1000000000
using namespace std;
template <class T>
inline void read(T &a)
{static char c;int f=0;
while (((c=getchar())<'0'||c>'9')&&(c!='-'));
if (c=='-') {a=0;f=1;}
else {a=c-'0';}
while ((c=getchar())<='9'&&c>='0') a=(a<<3)+(a<<1)+c-'0';
if (f) a=-a;
}
int n,fac[300005],inv[300005],ans=0;
ll a,b,tar;
inline int qpow(int a,int b)
{int res=1,tp=a;
while (b)
{if (b&1) res=1ll*res*tp%mod;
tp=1ll*tp*tp%mod;b>>=1;
}
return res;
}
inline int cal(int a,int b)
{return 1ll*(1ll*fac[a]*inv[b]%mod)*inv[a-b]%mod;}
int main (){
	int i,j,k;fac[0]=1;
	scanf ("%d%lld%lld%lld",&n,&a,&b,&tar);
	for (i=1;i<=n;i++) fac[i]=1ll*fac[i-1]*i%mod;
	inv[n]=qpow(fac[n],mod-2);
	for (i=n-1;i>=0;i--) inv[i]=1ll*inv[i+1]*(i+1)%mod;
	for (i=0;i<=n;i++)
	{ll c1=i,c2=(tar-1ll*c1*a)/b;
	if (c2<0||c2>n||a*c1+b*c2!=tar) continue;
	ans+=1ll*cal(n,c1)*cal(n,c2)%mod;
	ans=(ans>=mod?ans-mod:ans);
	}
	printf ("%d\n",ans);
	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define F first
#define S second
#define um map <ll,ll>
#define rep(i,z,n)  for(int i=z;i<n;i++)
#define repi(i,z,n) for(int i=z;i<=n;i++)
#define repn(i,z,n) for(int i=n-1;i>=z;i--)
#define vec vector<ll>
#define vecp vector<pair<ll,ll>>
#define pi (double)3.14159265358979323846
#define ld long double
#define all(z) z.begin(),z.end()

ll power(ll a, ll b, ll m) { ll ans = 1; a = a % m; if (a == 0) return 0; while (b) { if (b & 1) ans = (ans * a) % m; b /= 2; a = (a * a) % m; } return ans; }
ll modInverse(ll a, ll m) {return power(a, m - 2, m);}
ll binpow(ll a, ll b) {ll res = 1; while (b > 0) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll binlog2(ll n) {ll logValue = -1; while (n) {logValue++; n >>= 1;} return logValue;}
void print(vec a) {rep(i, 0, a.size())cout << a[i] << " "; cout << endl;}
const ll mod = 1e9 + 7;
const ll N = 1e3 + 5;
const ll inf = 2e18;
char a[N][N];
ll dp[N][N];
ll n, m;

ll dfs(ll i, ll j) {
    if (i == n && j == m)
        return 1;
    if (i < 1 || i > n || j < 1 || j > m || a[i][j] == '#')
        return 0;
    if (dp[i][j] != -1)
        return dp[i][j];
    ll l = 0, r = 0;
    l = dfs(i + 1, j);
    r = dfs(i, j + 1);

    return dp[i][j] = (l + r) % mod;
}

void solve() {
    cin >> n >> m;
    repi(i, 1, n) {
        repi(j, 1, m)
        cin >> a[i][j];
    }
    memset(dp, -1, sizeof(dp));
    cout << dfs(1, 1) << endl;
}








int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    speed;
    int test = 1;
    // cin >> test;
    while (test--) {
        // cout << "Case #" << t1 << ": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 12656
use proconio::{input, fastout};
use std::cmp::Reverse;
#[fastout]
fn main() {
    input!{
        n:usize,
        mut a:[usize;n]
    }
    a.sort_by_key(|&num| Reverse(num));
    let mut ans = a[0]; let mut c = 1;
    for i in 1..n {
        for j in 0..2 {
            if c >= n-1 {
                println!("{}",ans);
                return;
            }
            ans += a[i];
            c += 1;
        }
    }
}


Measured memory_bytes: 6216
#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define endl "\n"
const int MAX= 100005 ;
const long long mod = 1.0e9+7;
ll ceil(ll a,ll b)
{
    if(a%b==0)
    {
        return a/b;
    }
    else
    {
        return a/b+1;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,k,i;
    cin>>n>>k;
    if(k>ceil(n,2))
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
    }
    return 0;
}

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

using namespace std;

class DICE{
  /*
   * top = 0, right = 1, up = 2, left = 3, down = 4, bottom = 5; 
   */
public:
  DICE(int a, int b, int c, int d, int e, int f){
    v[0] = a;
    v[1] = b;
    v[2] = c;
    v[3] = d;
    v[4] = e;
    v[5] = f;
  }

  DICE(int a, int b, int c){
    v[0] = a;
    v[1] = b;
    v[2] = c;
    v[3] = 7-b;
    v[4] = 7-c;
    v[5] = 7-a;
  }
  int v[6];

  void rotate(int arg){
    int tmp=v[0];
    if(arg == 0){
      //North
      v[0] = v[4];
      v[4] = v[5];
      v[5] = v[2];
      v[2] = tmp;
    }else if(arg == 1){
      //East
      v[0] = v[3];
      v[3] = v[5];
      v[5] = v[1];
      v[1] = tmp;
    }else if(arg == 2){
      //West
      v[0] = v[1];
      v[1] = v[5];
      v[5] = v[3];
      v[3] = tmp;
    }else if(arg == 3){
      //South
      v[0] = v[2];
      v[2] = v[5];
      v[5] = v[4];
      v[4] = tmp;
    }else if(arg == 4){
      //right
      tmp = v[4];
      v[4] = v[1];
      v[1] = v[2];
      v[2] = v[3];
      v[3] = tmp;
    }else{
      tmp = v[4];
      v[4] = v[3];
      v[3] = v[2];
      v[2] = v[1];
      v[1] = tmp;
    }
  }

  int top(void){
    return v[0];
  }

  int bottom(void){
    return v[5];
  }
};

int main(void){
  int n;
  string str;
  while(cin >> n && n){
    DICE d = DICE(1,3,5);
    int ret = 0;
    string str;
    while(n--){
      cin >> str;
      if(str == "North"){
	d.rotate(0);
      }else if(str == "East"){
	d.rotate(1);
      }else if(str == "West"){
	d.rotate(2);
      }else if(str == "South"){
	d.rotate(3);
      }else if(str == "Right"){
	d.rotate(4);
      }else if(str == "Left"){
	d.rotate(5);
      }
      ret += d.top();
    }
    cout << ret+1 << endl;
  }
}

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

xmi = 1e18
xma = -1e18
ymi = 1e18
yma = -1e18
for i in range(n):
    x, y = map(int, input().split())
    xmi = min(xmi, x+y)
    xma = max(xma, x+y)
    ymi = min(ymi, x-y)
    yma = max(yma, x-y)
ans = 0
ans = max(ans, xma - xmi)
ans = max(ans, yma - ymi)
print(ans)


Measured memory_bytes: 9216
#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

bool can[10];
int n , k , sum = 0;
int main(){
	cin >> n >> k;
	memset(can , 1 , sizeof can);
	for(int i = 1 ; i <= k ; ++ i){
		int dig;
		cin >> dig;
		can[dig] = 0;
	}
	for(int i = 1 ; i <= 100000 ; ++ i){
		int cur = i;
		bool ok = 1;
		while(cur){
			if(!can[cur % 10]){
				ok = 0;
				break;
			}
			cur /= 10;
		}
		if(ok && i >= n){
			cout << i << endl;
			return 0;
		}
	}	
	return 0;		
}

Measured memory_bytes: 256
X, Y, A, B, C = map(int, input().split())
pl = list(map(int, input().split()))
ql = list(map(int, input().split()))
rl = list(map(int, input().split()))
pl.sort(reverse=True)
ql.sort(reverse=True)
rl.sort(reverse=True)

total = pl[:X]+ql[:Y]+rl[:X+Y]
total.sort(reverse=True)
result = sum(total[:X+Y])

print(result)

Measured memory_bytes: 23328
#include<algorithm>
#include<cmath>
#include<cstdint>
#include<cstdio>
#include<functional>
#include<iostream>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<numeric>
using namespace std;

#define loop(i,a,b) for(int i=(a); i<(b); ++i)
#define rep(i,n) for(int i=0; i<n; ++i)
#define all(v) begin(v), end(v)
#define dump(a) cerr << #a << " = " << (a) << "(L:" << __LINE__ << ")" << endl

const double PI = acos(-1.0);

int main() {
  std::ios::sync_with_stdio(false);
  int n, x;
  cin >> n >> x;
  vector<int> m(n);
  rep(i,n) cin >> m[i];
  sort(all(m));
  cout << n + (x - accumulate(m.begin(), m.end(), 0)) / m[0] << endl;
  return 0;
}


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

using namespace std;

int main(){
  int x,a,b; cin>>x>>a>>b; 
  int d=a-x;
  if(d<0) d=d*(-1);
  int e=b-x;
  if(e<0) e=e*(-1);
  
  if(d<e) cout<<"A";
  else cout<<"B";
  
 
  
  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Lesson7C 表の行数rと列数c、r × c の要素を持つ表を読み込んで、
 * 各行と列の合計を挿入した新しい表を出力するプログラム
 *
 * @author Internship
 *
 */
public class Main{

	/**
	 * プログラムのエントリポイント
	 *
	 * @param args
	 */
	public static void main(String[] args) {


		//行や列の各数字の一時保管場所
		int intVector = 0;

		//入力値の各行の文字列の一時保管場所
		String strLineAll = "";

		//行の合計値
		int intColumnSum = 0;

		//行と列の全合計値
		int intSum = 0;

		//一行目を読み込む
		try {
			BufferedReader insBR = new BufferedReader(new InputStreamReader(System.in));

			String strLine1 = insBR.readLine();

			//ばらけさせる
			String[] strAryLine1 = strLine1.split(" ");

			//行の数
			int intLine = Integer.parseInt(strAryLine1[0]);

			//列の数
			int intColumn = Integer.parseInt(strAryLine1[1]);

			//行と列が決まったところで配列の大きさが決まる
			int[][] intTable = new int[intLine + 1][intColumn + 1];

			//二行目以降を読み込む
			//i行目
			for(int i = 0; i < intLine; i++) {
				strLineAll = insBR.readLine();

			//ばらけさせる
				String[] strAryLine = strLineAll.split(" ");

				//int型にキャスト
				//j列目
				for(int j = 0; j < intColumn; j++) {
					intVector = Integer.parseInt(strAryLine[j]);

					//配列に格納
					//i行のj列
					intTable[i][j] = intVector;

					//行の合計値をカウント
					intColumnSum += intVector;

					//列の合計値をカウント
					intTable[intLine][j] += intVector;

					//総合計値をカウント
					intSum += intVector;
				}
				//行の合計値を代入
				intTable[i][intColumn] = intColumnSum;

				//1行分終わったのでリセット
				intColumnSum = 0;
			}

			//総合計値を代入
			intTable[intLine][intColumn] = intSum;

			//計算して出力
			for(int i = 0; i <= intLine; i++) {
				for(int j = 0; j <= intColumn; j++) {

					if(j == 0) {
						System.out.print(intTable[i][j]);
					}else {
						System.out.print(" " + intTable[i][j]);
					}
				}
				System.out.println("");
			}

		} catch (IOException e) {
			System.out.println(e);
		} catch (NumberFormatException e) {
			System.out.println("数字で入力して下さい");
		}
	}
}

Measured memory_bytes: 25412
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <map>
#include <iomanip>
#include <limits.h>

using namespace std;    
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const bool DEBUG = true;

ll POW2(ll depth){
    ll ret = 1;
    for(ll i = 0; i < depth; i++){
        ret *= 2;
    }
    return ret;
}

int main(){

    ll H;
    cin >> H;

    ll depth = 0;
    ll sum = 0;
    while (H != 0)
    {   
        sum += POW2( depth );
        H /= 2;
        depth ++;

    }
    cout << sum << endl;


}

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

#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

int main(){
    string w;cin>>w;
    vector<int> v(26,0);
    int n=w.size();
    rep(i,n){
        v[w[i]-'a']++;
    }

    for(int i=0;i<26;i++){
        if(v[i]%2!=0){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  int a,b;
  cin>>a>>b;
  if(a==2||b==2)
    cout<<"No";
  else
    cout<<"Yes";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const ll INF=1e12;
const int MOD=1e9+7;
const double pi=acos(-1);

int main(){
  ll n;
  cin >> n;
  ll ans=INF;
  for(ll i=1;i*i<=n;i++){
    if(n%i==0){
      ans = min(ans,i+n/i-2);
    }
  }
  cout << min(ans,n-1) << endl;
}


Measured memory_bytes: 256
from collections import Counter
from statistics import mode


n = int(input())
V = list(map(int, input().split()))

A = V[::2]
B = V[1::2]
countA = sorted(list(Counter(A).items()), key=lambda x: -x[1])
countB = sorted(list(Counter(B).items()), key=lambda x: -x[1])
if len(set(V)) == 1:
    print(n//2)
elif countA[0][0] != countB[0][0]:
    print(len(A)-countA[0][1] + len(B)-countB[0][1])
else:
    print(min(
        len(A)-countA[0][1] + len(B)-countB[1][1],
        len(A)-countA[1][1] + len(B)-countB[0][1]
        ))

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

int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
/*
ll t;
cin>>t;
while(t--)
{
*/

ll n,m,i;
cin>>n>>m;
ll a[m];
string s[m];

for(i=0;i<m;i++)
cin>>a[i]>>s[i];

ll pena=0;
ll w[n+1]={0};
ll ac[n+1]={0};

for(i=0;i<m;i++)
{
  if(ac[a[i]]>0)
    continue;
  if(s[i]=="WA")
   w[a[i]]++;
  else
  {
    pena+=w[a[i]];
    ac[a[i]]++;
  }

}


ll sco=0;

for(i=1;i<=n;i++)
{
  if(ac[i]>0)
    sco++;
}

cout<<sco<<" "<<pena<<endl;


return 0;
}



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

typedef long long ll;
typedef pair<int,int> ii;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int a,b,c,x; cin>>a>>b>>c>>x;
	int ret=0;
	for (int i=0; i<=a; i++) for (int j=0; j<=b; j++) for (int k=0; k<=c; k++)
		if(500*i+100*j+50*k==x)
			ret++;
	cout << ret << endl;
	return 0;
}


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

using namespace std;

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

int a, b, c, x;

bool dfs(int s, int t, int u){
    if (s * 500 + t * 100 + u * 50 == x){
        return true;
    }
    return false;
}

int main(){
    cin >> a >> b >> c >> x;
    int ans = 0;
    rep(i, a + 1)rep(j, b + 1)rep(k, c + 1){
        if (dfs(i, j, k)){
            ans++;
        }
    }
    cout << ans << endl;
}

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

using namespace std;

int main(int argc, const char *argv[]) {
  string s;
  cin >> s;

  auto solve = [&](int init) {
    int cur = init, ans = 1, prev_len = init;
    while (cur < s.size()) {
      if (prev_len == 2 || s[cur] != s[cur - 1]) {
        cur++;
        ans++;
        prev_len = 1;
        continue;
      }

      if (cur == s.size() - 1) {
        break;
      }

      cur += 2;
      ans++;
      prev_len = 2;
    }

    return ans;
  };

  cout << max(solve(1), solve(2)) << '\n';
  return 0;
}


Measured memory_bytes: 640
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn calc_area(t: f64, seq: &Vec<(f64, f64, usize)>) -> f64 {
    let n = seq.len();
    let mut max_x = -1e+9;
    let mut max_y = -1e+9;
    let mut min_x = 1e+9;
    let mut min_y = 1e+9;
    for i in 0..n {
        let dx = [1.0, -1.0, 0.0, 0.0][seq[i].2];
        let dy = [0.0, 0.0, 1.0, -1.0][seq[i].2];
        let x = seq[i].0 + dx * t;
        let y = seq[i].1 + dy * t;
        max_x = f64::max(max_x, x);
        max_y = f64::max(max_y, y);
        min_x = f64::min(min_x, x);
        min_y = f64::min(min_y, y);
    }
    return (max_x - min_x) * (max_y - min_y);
}

fn find_cross_ts(seq: &Vec<(f64, f64, usize)>) -> Vec<f64> {
    let n = seq.len();
    let mut max_xs = vec![-1e+9, -1e+9, -1e+9];
    let mut min_xs = vec![1e+9, 1e+9, 1e+9];
    for i in 0..n {
        let mut d = seq[i].2;
        if d == 3 {
            d = 2;
        }
        let x = seq[i].0;
        max_xs[d] = f64::max(max_xs[d], x);
        min_xs[d] = f64::min(min_xs[d], x);
    }
    let mut ret = vec![];
    ret.push((max_xs[0] - max_xs[1]).abs() / 2.0);
    ret.push((min_xs[0] - min_xs[1]).abs() / 2.0);
    ret.push((max_xs[0] - max_xs[2]).abs());
    ret.push((min_xs[0] - min_xs[2]).abs());
    ret.push((max_xs[1] - max_xs[2]).abs());
    ret.push((min_xs[1] - min_xs[2]).abs());
    return ret;
}

fn main() {
    let n = read::<usize>();
    let mut seq = vec![(0.0, 0.0, 0); n];
    for i in 0..n {
        seq[i].0 = read::<f64>();
        seq[i].1 = read::<f64>();
        let d = read::<String>().chars().collect::<Vec<char>>()[0];
        seq[i].2 = match d {
            'R' => 0,
            'L' => 1,
            'U' => 2,
            'D' => 3,
            _ => unimplemented!(),
        }
    }
    let mut ans = calc_area(0.0, &seq);
    for _iter in 0..2 {
        let candidate = find_cross_ts(&seq);
        for &t in candidate.iter() {
            ans = f64::min(ans, calc_area(t, &seq));
        }
        // x, y swap
        for i in 0..n {
            let t = seq[i].0;
            seq[i].0 = seq[i].1;
            seq[i].1 = t;
            seq[i].2 ^= 2;
        }
    }
    println!("{:.10}", ans);
}


Measured memory_bytes: 8444
import fractions
import collections
N = int(input())
As = list(map(int, input().split()))
lgcd = [As[0]]
rgcd = collections.deque([As[-1]])
l = As[0]
r = As[-1]
for i in range(1, N):
    l = fractions.gcd(l, As[i])
    r = fractions.gcd(r, As[-(i+1)])
    lgcd.append(l)
    rgcd.appendleft(r)
ans = [lgcd[N-2], rgcd[1]]
for i in range(1, N-1):
    ans.append(fractions.gcd(lgcd[i-1], rgcd[i+1]))
print(max(ans))

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

const int MN = 2005;
int n, m, a[MN][MN], l[MN][MN], h[MN], ans;
stack<int> st;

int main(){
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++){
		char buf[MN];
		scanf("%s", buf + 1);
		for(int j = 1; j <= m; j++) a[i][j] = (buf[j] == '#');
	}
	for(int i = 1; i < m; i++){
		l[n][i] = 1;
		for(int j = n - 1; j >= 1; j--){
			l[j][i] = (l[j + 1][i] * !(a[j][i] ^ a[j][i + 1] ^ a[j + 1][i] ^ a[j + 1][i + 1])) + 1;
		}
	}
	for(int i = 1; i <= n; i++){
		for(int j = m; j >= 1; j--){
			h[j] = n - i + 1;
			int ch = l[i][j];
			int lst = 0;
			while(!st.empty()){
				if(h[st.top()] < ch) break;
				lst = st.top();
				ans = max(ans, (st.top() - j) * h[st.top()]);
				st.pop();
			}
			if(lst){
				h[lst] = ch;
				st.push(lst);
			}
			st.push(j);
		}
		while(!st.empty()){
			ans = max(ans, st.top() * h[st.top()]);
			st.pop();
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 31616
#include<stdio.h>
int main(){
	int n;
	int s[101];
	int i,j;
	int max=0,min=1000000,t=0;
	
	for(;;max=0,min=1000000,t=0){
		scanf("%d",&n);
		if(n==0)break;
		for(i=0;i<n;i++){
			scanf("%d",&s[i]);
			if(s[i]>max)max=s[i];
			if(s[i]<min)min=s[i];
		}
		for(i=0;i<n;i++)t+=s[i];
		t-=(min+max);
		t/=(n-2);
		printf("%d\n",t);
	}
	return 0;
}

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

const int maxn = 2e5 + 10;
int lef[maxn], rig[maxn], a[maxn];

int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    int n;
    cin >> n;
    for(int i=0; i<n; i++) cin >> a[i];
    stack<int> st;
    for(int i=0; i<n; i++){
        while(st.size() && a[i] < a[st.top()]) st.pop();
        lef[i] = (st.size() ? st.top() : -1);
        st.push(i);
    }
    while(st.size()) st.pop();
    for(int i=n; i--; ){
        while(st.size() && a[i] < a[st.top()]) st.pop();
        rig[i] = (st.size() ? st.top() : n);
        st.push(i);
    }
    ll ans = 0;
    for(int i=0; i<n; i++)
        ans += 1LL * (i - lef[i]) * (rig[i] - i) * a[i];
    cout << ans << endl;

}


Measured memory_bytes: 3456
n = int(input())
s = list(map(int, input()))

ans = 0
for i in range(10):
    if i in s[: n - 2]:
        x = s.index(i)
        for j in range(10):
            if j in s[x + 1: n - 1]:
                y = x + 1 + s[x + 1: n - 1].index(j)
                for k in range(10):
                    if k in s[y + 1:]:
                        ans += 1
print(ans)

Measured memory_bytes: 3640
import bisect

n = int(input())
a = [int(input()) for i in range(n)]

b = []
for i in range(n):
    k = bisect.bisect(b,-a[i])
    if k == len(b):
        b.append(-a[i])
    else:
        b[k] = -a[i]

print(len(b))

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

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll INF = 1LL << 60;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

#define int long long

inline void my_io() {

	std::ios::sync_with_stdio(false);

	std::cin.tie(0);

	cout << fixed << setprecision(16);

	//cout << setprecision(10) << scientific << ans << endl;
}

signed main() {
	ll x1, y1, x2, y2, l;

	cin >> x1 >> y1 >> x2 >> y2;

	ll x = x2 - x1;
	ll y = y2 - y1;

	cout << x2 - y << " " << y2 + x << " " << x1 - y << " " << y1 + x << endl;
}

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

using namespace std;

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

    int out=0;
    if(k<=a) out = k;
    else if(k <=(a+b)) out = a;
    else out = a - (k- a - b);
    cout << out << endl;
    return 0;
}

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

int main(){
    int N,x;
    cin >> N >> x;
    int a[N];
    for(int i=0; i<N; i++){
        cin >> a[i];
    }

    long long total = 0;
    for(int pairIndex=0; pairIndex<N-1; pairIndex++){
        int first = pairIndex;
        int second = pairIndex+1;
        if(a[first] > x){
            int diff = a[first] - x;
            a[first] -= diff;
            total += diff;
        }
        if(a[first] + a[second] > x){
            int diff = a[first] + a[second] - x;
            a[second] -= diff;
            total += diff;
        }
    }

    cout << total << '\n';


}




Measured memory_bytes: 3580
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int
#define ulli unsigned long long int
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pf pop_front()
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define loopl(i,a,b) for(lli i=a;i<b;i++) 
#define loop(i,a,b) for(int i=a;i<b;i++)
#define mod 1000000007
#define inf 1000000000000000
#define lld long double
#define pll pair<long long int,long long int>
#define vll vector<lli>
#define eps 0.000001
//#define endl '\n'

using namespace std ;

#define MAXN 100010
/*lli spf[MAXN];  
void sieve();
set<lli> factors(lli x);
lli power(lli x,lli y,lli p);
*/
//void getZarr(string str, lli Z[]);
//vll prefix_function(vll s); 

typedef tree<lli,null_type,less<lli>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

int main()
{

    lli a,b;
    cin>>a>>b;
    if(b%a == 0) cout<<b+a<<endl;
    else cout<<b-a<<endl;
}


/*vll prefix_function(vll s) 
{
    lli n = (lli)s.size();
    vll pi(n);
    
    for (lli i = 1; i < n; i++)
    {
        lli j = pi[i-1];
        
        while (j > 0 && s[i] != s[j])
            j = pi[j-1];
        
        if (s[i] == s[j])
            j++;
        
        pi[i] = j;
    }
    return pi;
}
*/
/*void sieve() 
{ 
    spf[1] = 1; 
    loopl(i,2,MAXN) 
        spf[i] = i; 
    for (lli i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (lli i=3; i*i<MAXN; i++) { 
        if (spf[i] == i) { 
            for (lli j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    }

} 

multiset<lli> factors(lli x) 
{ 
    multiset<lli> pr; 
    while (x != 1) 
    { 
        pr.insert(spf[x]); 
        x = x / spf[x]; 
    } 
    return pr; 
}

*/

/*
void dfs(lli q,lli root) 
{
    vis[q]=1;
    
    ans[q]=1;

    for(auto x: v[q])
    {
        if(!vis[x])
        {
            if(a[x]==a[root] && x<root) continue;
            if(a[x]<a[root] || a[x]>a[root]+d) continue;
            dfs(x,root);
            ans[q]=(ans[q]*((ans[x]+1)%mod))%mod ;
        }
    }
        
}
*/



/*void getZarr(string str, lli Z[])
{
    lli n = str.length();
    lli L, R, k;
    L = R = 0;
    for (lli i = 1; i < n; ++i){
        if (i > R){
            L = R = i;
            while (R<n && str[R-L] == str[R])
                R++;
            Z[i] = R-L;
            R--;
        } else {
            k = i-L;
            if (Z[k] < R-i+1)
                Z[i] = Z[k];
            else {
                L = i;
                while (R<n && str[R-L] == str[R])
                    R++;
                Z[i] = R-L;
                R--;
            }
        }
    }
}


*/
/*
lli power(lli x, lli y, lli p) 
{ 
    lli res = 1;   
    x = x % p;  
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
  
        y = y>>1;  
        x = (x*x) % p;   
    } 
    return res; 
} 
*/

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

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589

using namespace std;

int gcd(int a, int b);
int lcm(int a, int b);

void solve_A(){
    int n, m;
    cin >> n >> m;

    if(n <= m) cout << "Yes";
    else cout << "No";
}

void solve_B(){
    
}

void solve_C(){
    
}

int main(void){
    solve_A();
    solve_B();
    solve_C();
    
    return 0;
}

int gcd(int a, int b){
    if(a < b) swap(a, b);

    int r = a % b;
    while(r != 0){
        a = b;  b = r;  r = a % b;
    }
    return b;
}

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

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

#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

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

  int H, W;
  cin >> H >> W;

  REP(i, W + 2) { cout << '#'; }
  cout << endl;
  char a;
  REP(i, H) {
    cout << '#';
    REP(j, W) {
      cin >> a;
      cout << a;
    }
    cout << '#';
    cout << endl;
  }
  REP(i, W + 2) { cout << '#'; }
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main(int argc, const char * argv[])
{
    string str;
    string stuck;
    string result;
    int first = 1;
    int strnum = 0;
    getline(cin, str);
    for (int i = 0; i < str.size(); i++) {
        if (str[i] == ',' || str[i] == '.' || str[i] == ' ') {
            if (2 < strnum && strnum < 7) {
                if (first) {
                    first--;
                }
                else {
                    result += ' ';
                }
                result += stuck;
            }
            strnum = 0;
            stuck = "";
        }
        else {
            stuck += str[i];
            strnum++;
        }
    }
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 1180
#include <iostream>
#include <cstdio>
using namespace std;
const int P=998244353;
const int G=3;
const int L=16384;
int fact[L],invf[L],f[L],g[L],h[L],t[L],trs[L];
int omega[L+5];
int n,m,len,ans;
inline int quick_power(int x,int y)
{
	int ret=1;
	for (;y;y>>=1,x=1ll*x*x%P) if (y&1) ret=1ll*ret*x%P;
	return ret;
}
void pre()
{
	fact[0]=1;
	for (int i=1;i<L;++i) fact[i]=1ll*fact[i-1]*i%P;
	invf[L-1]=quick_power(fact[L-1],P-2);
	for (int i=L-1;i>=1;--i) invf[i-1]=1ll*invf[i]*i%P;
}
inline int C(int n,int m){return n>=m?1ll*fact[n]*invf[m]%P*invf[n-m]%P:0;}
void NTT_pre()
{
	for (len=1;len<=n<<1;len<<=1);
	for (int i=0,ret;i<len;++i)
	{
		ret=0;
		for (int x=i,j=1;j<len;j<<=1,x>>=1) ret=(ret<<1)|(x&1);
		trs[i]=ret;
	}
	int g=quick_power(G,(P-1)/len);omega[0]=1;
	for (int i=1;i<=len;++i) omega[i]=1ll*omega[i-1]*g%P;
}
void DFT(int *a,int sig)
{
	for (register int i=0;i<len;++i) t[trs[i]]=a[i];
	for (register int l=2;l<=len;l<<=1)
		for (register int h=l>>1,j=0,wn=omega[sig>0?len/l:len-len/l];j<len;j+=l)
			for (register int i=0,w=1;i<h;++i,w=1ll*w*wn%P)
			{
				register int u=t[i+j],v=1ll*t[i+j+h]*w%P;
				t[i+j]=(u+v)%P,t[i+j+h]=(u-v+P)%P;
			}
	for (register int i=0;i<len;++i) a[i]=t[i];
	if (sig<0) for (register int i=0,inv=quick_power(len,P-2);i<len;++i) a[i]=1ll*a[i]*inv%P;
}
int main()
{
	scanf("%d%d",&n,&m),pre(),NTT_pre();
	f[0]=1;
	for (int i=1;i<=n;++i) g[i]=invf[i+2];
	DFT(g,1);
	for (int i=1;i<=m;++i)
	{
		for (int j=0;j<=n;++j) h[j]=1ll*f[j]*invf[j]%P;
		for (int j=n+1;j<len;++j) h[j]=0;
		DFT(h,1);
		for (int j=0;j<len;++j) h[j]=1ll*h[j]*g[j]%P;
		DFT(h,-1);
		for (int j=0;j<=n;++j) f[j]=(1ll*fact[j+2]*h[j]%P+1ll*(C(j+1,2)+1)*f[j]%P)%P;
	}
	ans=0;
	for (int i=0;i<=n;++i) (ans+=1ll*C(n,i)*f[i]%P)%=P;
	printf("%d\n",ans);
	fclose(stdin),fclose(stdout);
	return 0;
}

Measured memory_bytes: 768