akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

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

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

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

const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };


bool is_set(pair<int, char>* c)
{
	return c[0].second == c[1].second && c[1].second == c[2].second
		&& (c[0].first == c[1].first && c[1].first == c[2].first
		|| c[0].first + 1 == c[1].first && c[1].first + 1 == c[2].first);
}
int main()
{
	int T;
	pair<int, char> c[9];
	cin >> T;
	while (T--)
	{
		rep (i, 9)
			cin >> c[i].first;
		rep (i, 9)
			cin >> c[i].second;
		sort(c, c + 9);

		int res = 0;
		do
		{
			if (is_set(c) && is_set(c + 3) && is_set(c + 6))
			{
				res = 1;
				break;
			}
		} while (next_permutation(c, c + 9));
		cout << res << endl;
	}
}

Measured memory_bytes: 0
import java.util.Scanner;
import java.util.Stack;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		Stack<Integer> s1 = new Stack<>();
		Stack<Integer> s2 = new Stack<>();
		Stack<Integer> s3 = new Stack<>();
		int sum = 0;
		int a;
		
		String str = sc.nextLine();
		int l = str.length();
		char[] c = str.toCharArray();
		for(int i=0;i<l;i++) {
			char ch = c[i];
			if(ch == '\\'){
				s1.push(i);
			}else if(ch == '/' && s1.size() > 0){
				int j = s1.pop();
				sum += i-j;
				a = i-j;
				while(s2.size()>0 && s2.peek() > j) {
					a += s3.pop();
					s2.pop();
				}
				s2.push(j);
				s3.push(a);
			}
		}
		
		int b = s3.size();
		int[] ans = new int[b];
		for(int i=b-1;i>=0;i--) { 
			ans[i] = s3.pop();
		}
		System.out.println(sum);
		System.out.print(b);
		for(int i=0;i<b;i++) {
			System.out.print(" " + ans[i]);
		}
		System.out.println();
	 }
}




Measured memory_bytes: 29608
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;


int rick[256];

int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall

	ini(n);
	ins(morty);
	FOR(i,0,256)rick[i]++;	
	FOR(i,0,n)rick[morty[i]]++;
	int tmp = 1;
	FOR(i,0,256) {tmp*=rick[i];tmp%=1000000007;}
	tmp+=1000000007;
	tmp-=1;
	tmp%=1000000007;
	out(tmp);
	
	
	
	





	return 0;
}


Measured memory_bytes: 512
#include<stdio.h>
int main(void){
  char s[2];
  int i;
  scanf("%s",s);
  for(i=0;i<3;i++)
    switch(s[i]-'0'){
      case 1:
        s[i]='9';
        break;
      case 9:
        s[i]='1';
          break;}
  printf("%s\n",s);
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
    using namespace std;
    # define LL long long
    # define int long long
    #define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    # define mo 998244353
    # define pi acos(-1)
    //vector<pair<int,int>> v;
    //int x0=INT_MAX,y0=INT_MAX;
    /*int crossprod(pair<int,int> a,pair<int,int> b,pair<int,int> c)
    {
        int x1 = a.first-b.first;
        int x2 = a.first-c.first;
        int y1 = a.second-b.second;
        int y2 = a.second-c.second;
        return x1*y2 - y1*x2;
    }
    int direction(pair<int,int> a,pair<int,int> b,pair<int,int> c) {
       int val = (b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y);
       if (val == 0)
          return 0;     //colinear
       else if(val < 0)
          return 2;    //anti-clockwise direction
          return 1;    //clockwise direction
    }*/
   vector<int> v[102];
    signed main(){
        gok

     string s;
     cin>>s;
     int n=s.size();
     int i=0,j=n-1;
     bool ch=true;
     while(i<j)
     {
         if(s[i]!=s[j])
         {
             ch=false;
             break;
         }
         i++;
         j--;
     }
    i=0;
    j=(n/2-1);
     while(i<j)
     {
         if(s[i]!=s[j])
         {
             ch=false;
             break;
         }
         i++;
         j--;
     }

      i=n/2 + 1;
      j=n-1;
       while(i<j)
     {
         if(s[i]!=s[j])
         {
             ch=false;
             break;
         }
         i++;
         j--;
     }

      if(ch)
        cout<<"Yes";
      else
        cout<<"No";










        return 0;
    }


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>

#define rep(i,n) for(int i=0;i<int(n);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back

using namespace std;
using ll = long long;


const ll mod = 1000000007;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
// bool debug=false;

/*---------------------------------------------------*/

#define int long long

int gcd(int a, int b) {
  if (b == 0) {
    return a;     
  }
  return gcd(b, a % b);
}

int lcm(int a,int b){
  if ( ( 0 == a ) || ( 0 == b ) )
    return 0;
  
  return ((a / gcd(a, b)) * b); 
}

signed main() {
  ll A, B, C, D;
  cin >> A >> B >> C >> D;
  ll _lcm = lcm(C, D);
  
  ll a = B / C - A / C;
  if(A % C == 0) a++;
  ll b = B / D - A / D;
  if(A % D == 0) b++;
  ll c = B / _lcm - A / _lcm;
  if(A % _lcm == 0) c++;
  
  cout << (B - A + 1) - (a + b) + c << endl;
  return 0;
}


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

struct Benri {
    Benri() {
        std::cin.tie(0); ios::sync_with_stdio(false);
        cout << fixed << setprecision(12);
    }
} benri;
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; }

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
using pll = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define MOD 1000000007
#define MOD2 998244353
const int INF = 1 << 28;



int main() {
    int N ; cin >> N;
    vi A(N),B(N),C(N-1);
    int ans = 0;
    rep(i,N) cin >> A[i];
    rep(i,N) {
        cin >> B[i];
        ans += B[i];
    }
    rep(i,N-1) cin >> C[i];

    rep(i,N-1){
        if(A[i+1] == A[i]+1) ans += C[A[i]-1];
    }

    cout << ans << endl;


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll a,b;
  	int k,i;
  	cin>>a>>b>>k;
  
  	if(b-a+1>2*k){
  	for(i=0;i<k;i++){
		cout<<a+i<<endl;
    }
  	
  	for(i=0;i<k;i++){
		cout<<b-k+i+1<<endl;
    }
    }else{
      for(i=a;i<=b;i++){
		cout<<i<<endl;
      }
    }
}


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

int n, k, d[15], i;

bool chk(int x){
int y;
while(x>0){
    y = x%10;
    x/=10;
    for(int i =0; i<k; i++){
        if(y==d[i])return false;
    }
}
return true;
}

int main(){
cin >> n >> k;
for(int i =0; i<k; i++){
    cin >> d[i];
}
for(i =n; ; i++){
    if(chk(i))break;
}
cout << i << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int H, N;
int dp[1123][11234];
int A[1123], B[1123];

int main() {
	cin >> H >> N;
	REP(i, N) scanf("%d %d", A + i, B + i);
	
	fill(dp[0], dp[N + 1], INF);
	dp[0][0] = 0;
	
	REP(i, N) {
		REP(j, 11234) { // ダメージ
			if (dp[i][j] == INF) continue;
			int nexj = min(H, j + A[i]);
			chmin(dp[i + 1][nexj], dp[i][j] + B[i]);
			chmin(dp[i][nexj], dp[i][j] + B[i]);
			chmin(dp[i + 1][j], dp[i][j]);
		}
	}
	cout << dp[N][H] << endl;
}


Measured memory_bytes: 45440
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(),(v).end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin >> n;
    vector<ll> res(n+1);
    FOR(i,1,101){
        FOR(j,1,101){
            FOR(k,1,101){
                if(i*i+j*j+k*k+i*j+j*k+k*i>n){
                    continue;
                }
                res[i*i+j*j+k*k+i*j+j*k+k*i]++;
            }
        }
    }
    FOR(i,1,n+1){
        cout << res[i] << endl;
    }
}


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


using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VPP vector<pair<int,pair<int,int>>>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)
typedef pair <int, int> P;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

const int  INF = 1 << 29;
const ll INFL = 1LL << 60;


VVI v;
int h, w, k;

void f(int i,int j,VI a) {

	if (j == h) {
		v.push_back(a);
		return;
	}
	FOR(k, 1, h - j + 1) {
		VI b = a;
		b.push_back(k);
		f(i, j + k, b);
	}



}



int main() {



	
	cin >> h >> w >> k;


	f(0, 0, {});

	VVB b(h, VB(w));

	REP(i, h)REP(j, w) {
		char a;
		cin >> a;
		if (a == '0')b[i][j] = 0;
		else b[i][j] = 1;
	}

	



	int ans = INF;

	REP(i, v.size()) {

		
		

		VI c(h, 0);
		int cnt = 0;
		REP(j, v[i].size()) {
			REP(l, v[i][j]) {
				c[cnt] = j;
				cnt++;
			}
		}
		VI a(v[i].size(), 0);
		VI d(v[i].size(), 0);
		bool check = false;
		int cn = 0;
		REP(j, w) {
			REP(l, h) {
				if (b[l][j]) {
					d[c[l]]++;
				}
			}
			bool as = true;
			REP(l, v[i].size()) {
				if (a[l] + d[l] > k) {
					as = false;
				}
			}
			if (as) {
				REP(l, v[i].size()) {
					a[l] += d[l];
					d[l] = 0;
				}
			}
			else {
				REP(l, v[i].size()) {
					if (d[l] > k) {
						cn = INF;
						break;
					}
				}
				cn++;
				REP(l, v[i].size()) {
					a[l] = d[l];
					d[l] = 0;
				}
			}
		}
		ans = min(ans, cn + (int)v[i].size() - 1);
	}


	cout << ans << endl;





}

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

int main()
{
	int x = 1, y = 1, n, value = 0;
	cin >> n;

	if (n == 0 || n == 1) value = 1;
	else
	{
		while (n > 1)
		{
			value = x + y;
			x = y;
			y = value;
			n--;
		}
	}
	cout << value << endl;

	return 0;
}

Measured memory_bytes: 3088
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(long long i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int digit(long long a){
    int r = 0;
    while(a>0){
        a/=10;
        r++;
    }
    return r;
}
int main(){
    long long n;
    cin >> n;
    int ans = 20;
    rep(i,1e5+7){
        if(n%(i+1)==0) ans = min(ans,digit(max(i+1,n/(i+1))));
    }
    cout << ans << endl;
}

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

int main(){
  int n,k; cin >> n >> k;
  int ans =0;
  rep(i,n){
    int x;
    cin >>x;
    ans += 2*min(x,k-x);
  }
  cout << ans<< endl;
}


Measured memory_bytes: 256
//g++ -std=c++11 -Wall test.cpp -o test -lm -g -O2
#include <bits/stdc++.h>
using namespace std;
#define sws                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl '\n'
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define vb vector<bool>
#define vs vector<string>
#define qi queue<int>
#define si stack<int>
#define s string
#define ll long long;

int main()
{
    sws;
    int AB, BC, CA;
    cin >> AB >> BC >> CA;
    cout << (AB * BC) / 2 << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;

int main(){
    string s;
    cin >> s;
    string ans = "No";
    if(s[0]=='9') ans="Yes";
    if(s[1]=='9') ans="Yes";
    cout << ans << endl;
    return 0;
}

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

using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)((x).size()))

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef long long int64;
typedef unsigned int uint;
typedef unsigned long long uint64;

#define gi(x) ((x) = F())
#define gii(x, y) (gi(x), gi(y))
#define giii(x, y, z) (gii(x, y), gi(z))

int F()
{
	char ch;
	int x, a;
	while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-');
	if (ch == '-') ch = getchar(), a = -1;
	else a = 1;
	x = ch - '0';
	while (ch = getchar(), ch >= '0' && ch <= '9')
		x = (x << 1) + (x << 3) + ch - '0';
	return a * x;
}

const int N = 2e5 + 10;

int n, p[N], f[N], t[N];

bool ck(int a, int b, int c)
{
	return (a < b && b < c) || (b < c && c < a) || (c < a && a < b);
}

int main()
{
	gi(n);
	for (int i = 1; i <= n; ++i) p[F()] = i;
	for (int i = n - 1; i; --i)
	{
		if (!t[i + 1])
		{
			if (p[i] > p[i + 1]) t[i] = 1, f[i] = i + 1;
		}
		else
		{
			if (ck(p[f[i + 1]], p[i], p[i + 1])) t[i] = t[i + 1], f[i] = f[i + 1];
			else t[i] = t[i + 1] + 1, f[i] = i + 1;
		}
	}
	printf("%d\n", t[1]);
	return 0;
}

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

#define NL '\n'
#define C char
#define D double
#define F float
#define S string
#define sz(x) x.size()
#define INF LONG_LONG_MAX
#define PI (2.0*acos(0.0))
#define sfi(x) scanf("%d",&x)
#define sfi2(x,y) scanf("%d %d",&x,&y)
#define sfi3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sfl(x) scanf("%lld",&x)
#define sfl2(x,y) scanf("%lld %lld",&x,&y)
#define sfl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sfd(x) scanf("%lf",&x);
#define max3(a,b,c) max(a,max(b,c))
#define max4(a,b,c,d) max(max3(a,b,c),d)
#define min3(a,b,c) min(a,min(b,c))
#define min4(a,b,c,d) min(a,min3(b,c,d))
#define pb push_back
#define all(x) x.begin(),x.end()
#define asort(x) sort(all(x));
#define dsort(x) sort(all(x), greater<int>())
#define unq(x) x.erase(unique(x.begin(),x.end()),x.end())
#define mem(ara,val) memset(ara,val,sizeof(ara))
#define READ freopen("input.txt","r",stdin)
#define WRITE freopen("output.txt","w",stdout)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

LL gcd(LL a,LL b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}
LL lcm(LL a,LL b)
{
    return a/gcd(a,b)*b;
}

LL bigmod(LL base, LL power, LL mod)
{
    if(power==0) return 1;
    else if(power%2==1)
    {
        LL value1 = base % mod; LL value2 = (bigmod(base,power-1,mod))%mod;
        return (value1*value2)%mod;
    }
    else
    {
        LL value1 = (bigmod(base,power/2,mod))%mod;
        return (value1*value1)%mod;
    }
}



int main()
{
    LD n;
    cin>>n;
    LD ans = 2*PI*n;
    cout<<fixed<<setprecision(20)<<ans;
}


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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    int n,k;cin >> n >> k;
    vl h(n+100);
    rep(i,n)cin>>h[i];
    vl dp(100010,L_INF);
    dp[0]=0;
    rep(i,n){
        rep1(j,k+1)
        chmin(dp[i+j],dp[i]+abs(h[i+j]-h[i]));
    }
    out(dp[n-1]);
}


Measured memory_bytes: 1792
package main

import (
	"fmt"
)

func main() {
	var s, t string
	fmt.Scan(&s, &t)

	if s[0] == t[2] && s[1] == t[1] && s[2] == t[0] {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Measured memory_bytes: 512
import math
N = int(input())
A = math.floor((N / 100))
B = math.floor(((N - (100*A)) / 10))
C = (N-100*A-10*B)



if A == 7:
    print("Yes")
elif B == 7:
    print("Yes")
elif C == 7:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9188
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
typedef unsigned int ui;
int main() {
	int n, w;
	while (cin >> n >> w, n) {
		int cur[11] = {};
		int v;
		for (int i = 0; i < n; i++) {
			cin >> v; cur[v / w]++;
		}
		int sup; int ma = 0;
		for (int i = 10; i >= 0; i--) {
			if (cur[i] > 0) {
				sup = i; break;
			}
		}
		for (int i = 0; i < 11; i++) {
			ma = max(ma, cur[i]);
		}
		double out = 0;
		for (int i = 0; i < sup; i++) {
			out += ((double)(sup - i) / (double)sup)*((double)cur[i] / (double)ma);
		}
		out += 0.01;
		cout << fixed << setprecision(6) <<out<< endl;
	}
	return 0;
}


Measured memory_bytes: 3092
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        StringBuilder[] ans = new StringBuilder[1000];
        int index = 0;
 
        while( n != 0 ){
            String[][] data = new String[n][2];
            for(int i = 0; i < n; i++){
                data[i][0] = stdIn.next();
                data[i][1] = stdIn.next();
            }
         
            int x = stdIn.nextInt();
            for(int i = 0; i < x; i++){
                String s = stdIn.next();
                for(int j = 0; j < n; j++){
                    if( s.equals(data[j][0]) ){
                        s = new String(data[j][1]);
                        break;
                    }
                }
                if( i == 0 ){
                    ans[index] = new StringBuilder(s);
                } else {
                    ans[index].append(s);
                }
             
            }
            index++;
            n = stdIn.nextInt();
        }
        for(int i = 0; i < index; i++){
            System.out.println(ans[i].toString());
        }
    }
}

Measured memory_bytes: 69096
main(){
	int n,a[51],i,j;
	for(;scanf("%d",&n),n;){
		for(i=0;i<n;i++)
			scanf("%d",a+i);
		a[n]=0;
		for(i=0;i<n;i++){
			for(j=i;a[j+1]==a[j]+1;j++);
			if(i)
				putchar(' ');
			if(i==j)
				printf("%d",a[i]);
			else{
				printf("%d-%d",a[i],a[j]);
				i=j;
			}
		}
		puts("");
	}
	exit(0);
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
using namespace std;

int main()
{
  int N;
  cin>>N;
  string ans="No";
  if(N/100==N%10) ans="Yes";
  cout<< ans  <<endl;
}



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

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

const int N = 2e5+10 , mod = 1e9+7;

int32_t main(){
   ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
   int n;
   cin >> n;
   int ans = 0;
   for(int i = 1 ; i <= n ; i++){
      int x;
      cin >> x;
      if(i % 2 == 1 && x % 2 == 1)
         ans++;
   }
   cout << ans;
   return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#ifdef LOCAL
#define lout cout
#else
stringstream devnull;
#define lout devnull
#endif
#define AMULET \
  cin.tie(0);  \
  ios::sync_with_stdio(false);
#define rep1(n) rep(_, n)
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep3(i, f, n) for (int i = f; i < n; i++)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> pi;
template <class C>
inline void vcin(C &c);
template <class C, class D>
inline void vcin(C &c, D &d);
template <class C>
inline void vcout(const C &c, const string separate = "\n");

bool is_prime(int n)
{
  if (n < 2)
    return false;
  if (n == 2)
    return true;
  if (n % 2 == 0)
    return false;
  for (int i = 3; i * i <= n; i += 2)
  {
    if (n % i == 0)
      return false;
  }
  return true;
}

int main()
{
  AMULET
  int q;
  cin >> q;
  vector<int> l(q), r(q);
  vcin(l, r);

  int n = *max_element(r.begin(), r.end());
  lout << n << endl;
  vector<int> s(n + 3, 0);
  for (int i = 1; i <= n; i += 2)
  {
    s[i + 2] = s[i] + (is_prime(i) && is_prime((i + 1) / 2));
    lout << i << ":" << (is_prime(i) && is_prime((i + 1) / 2)) << endl;
  }

  rep(i, q)
  {
    cout << s[r[i] + 2] - s[l[i]] << endl;
  }

  return 0;
}

template <class C>
inline void vcin(C &c)
{
  for (auto &a : c)
  {
    cin >> a;
  }
}
template <class C, class D>
inline void vcin(C &c, D &d)
{
  for (auto it1 = c.begin(), it2 = d.begin(); it1 != c.end() && it2 != d.end(); it1++, it2++)
  {
    cin >> *it1 >> *it2;
  }
}
template <class C>
inline void vcout(const C &c, const string separate)
{
  for (auto it = c.begin(); it != c.end(); it++)
  {
    if (it != c.begin())
      cout << separate;
    cout << *it;
  }
}


Measured memory_bytes: 2308
def int_raw():
    return int(raw_input())

def ss_raw():
    return raw_input().split()

def ints_raw():
    return map(int,ss_raw())

INF = 1<<29

DIV = 10**9+7

def make2d_arr(w,h,val =INF):
    return [[val]*w for i in xrange(h)]

def floyd_warshall(costs):
    N = len(costs)
    for k in xrange(N):
        for i in xrange(N):
            for j in xrange(N):
                costs[i][j]  = min(costs[i][j],costs[i][k]+costs[k][j])
    return costs

N = int_raw()
C =[]
dp = [0 for i in xrange(N)]

m_prev = {}
prevs = [-1 for i in xrange(N)]

for i in xrange(N):
    c = int_raw()
    C.append(c)
    if c in m_prev:
        prevs[i] = m_prev[c]
        m_prev[c]= i
    else:
        m_prev[c]=i
    
dp[0] =1

for x in xrange(1,N):
    cx = C[x]
    dp[x] = dp[x-1]
    if cx == C[x-1]:
        continue
    y = prevs[x]
    if y != -1:
        dp[x]+=dp[y]
        dp[x]= dp[x]%DIV        
    """for y in xrange(x-2,-1,-1):
        cy = C[y]
        if cx == cy:
            dp[x]+=dp[y]
            dp[x]= dp[x]%DIV
            break"""

print dp[-1] 





Measured memory_bytes: 33984
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int inf = INT_MAX;
const ll INF = LLONG_MAX;
const ll MOD = 1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b, const ll mod=MOD) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b, const ll mod=MOD) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b, const ll mod=MOD) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b, const ll mod=MOD) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n; cin >> n;
    vi res(n);
    rep(i, n){
        int x; cin >> x; x--;
        res[x] = i + 1;
    }

    rep(i, n){
        cout << (i ? " ":"") << res[i];
    }
    cout << endl;

    return 0;
}


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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vvll = vector<vll>;
using vchar = vector<char>;
#define rep(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
ll mod = 1000000007;

int main(){
  ll a, b;
  cin >> a >> b;
  ll ans = 0;
  rep(i, a, b + 1){
    st sti = to_string(i);
    if(sti.at(0) == sti.at(4) && sti.at(1) == sti.at(3)) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <random>
#include <complex>
#include <assert.h>

using namespace std;
typedef long long ll;
#define endl '\n'

/////////////         modの計算

#define MOD_IS_PRIME
constexpr ll mod = 1000000007LL;

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

	constexpr int K = 16;

	vector<ll> v_e = { 0, 765144583, 346175634, 347662323, 5655049, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };
	vector<ll> v_o = { 539588932, 729548371, 700407153, 404391958, 962779130, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 869418286 };

	int T; cin >> T;
	for (int _t = 0; _t < T; _t++) {
		ll N; cin >> N;
		if (N % 2 == 0) {// even
			ll ans = 0;
			ll x = 1;
			for (int i = 0; i < K; i++) {
				ans += x * v_e[i];
				x *= N;
				if (ans >= mod) { ans %= mod; }
				if (x >= mod) { x %= mod; }
			}
			cout << ans << endl;
		}
		else {// odd
			ll ans = 0;
			ll x = 1;
			for (int i = 0; i < K; i++) {
				ans += x * v_o[i];
				x *= N;
				if (ans >= mod) { ans %= mod; }
				if (x >= mod) { x %= mod; }
			}
			cout << ans << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 3152
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

bool isBipartite(vector<vector<int>> &G) {
    vector<int> colors(G.size(), -1);
    colors[0] = 0;

    queue<int> Q;
    Q.push(0);
    while (!Q.empty()) {
        auto v = Q.front(); Q.pop();
        for (auto g : G[v]) {
            if (colors[g] == -1) {
                colors[g] = (colors[v] ^ 1);
                Q.push(g);
            } else if (colors[g] == (colors[v] ^ 1)) {
                continue;
            } else {
                return false;
            }
        }
    }
    return true;
}

void WarshallFloyd(vector<vector<int>> &D) {
    REP(k, 0, D.size()) {
        REP(i, 0, D.size()) {
            REP(j, 0, D.size()) {
                D[i][j] = min(D[i][j], D[i][k] + D[k][j]);
            }
        }
    }
}

int main() {
    int N; cin >> N;
    vector<string> S(N);
    REP(i, 0, N) cin >> S[i];

    vector<vector<int>> G(N);
    vector<vector<int>> D(N, vector<int>(N, 1 << 29));
    REP(i, 0, N) REP(j, 0, N) if (S[i][j] == '1') {
        G[i].push_back(j);
        D[i][j] = 1;
    }

    if (!isBipartite(G)) {
        cout << -1 << endl;
        return 0;
    }

    WarshallFloyd(D);

    int ans = 0;
    REP(i, 0, N) REP(j, 0, N) if (i != j && D[i][j] < (1 << 29)) ans = max(ans, D[i][j]);
    cout << ans + 1 << endl;
    
    return 0;
}

Measured memory_bytes: 3988
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
const int MAXN = 500100;

int N;
string s;
int A[MAXN];
int blo[MAXN];
int res[MAXN];

int main()
{
    ios_base::sync_with_stdio(0);

    cin >> s;
    N = s.length();
    
    blo[N] = 0;
    for (int i = N - 1; i >= 0; i--)
    {
        if (s[i] == '<')
        {
            blo[i] = 0;
        }
        else
        {
            blo[i] = blo[i+1] + 1;
        }
    }

    res[0] = blo[0];
    for (int i = 0; i < N; i++)
    {
        if (s[i] == '<')
        {
            res[i+1] = max (blo[i+1], res[i] + 1);
        }
        else
        {
            res[i+1] = blo[i+1];
        }
    }

    ll ans = 0;
    for (int i = 0; i <= N; i++)
        ans += res[i];
    cout << ans << "\n";
}

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()
 
using namespace std;
using ll = long long;
 
struct edge { int to, cost; };
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int MOD = 1e9+7;
const double EPS = 1.0e-10;
const double PI = acos(-1.0);
 
const int mx4[] = {0,1,0,-1};
const int my4[] = {1,0,-1,0};
const int mx8[] = {0,1,1,1,0,-1,-1,-1};
const int my8[] = {1,1,0,-1,-1,-1,0,1};

int main(){
	string s;
	cin >> s;
	rep(i,s.size()) cout << 'x';
	cout << endl;
	return 0;
}


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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

l = factorization(x)
l = sorted(l)
ans = 0
for i in range(len(l)):
  if l[i][0] == 1:
    continue
  else:
    s = 0
    num = l[i][1]
    if num == 1:
      j = 1
    else:
      for j in range(1, num):
        s += j
        if s == num:
          break
        elif s > num:
          j -= 1
          break
    ans += j
    
print(ans)

Measured memory_bytes: 9480
#include<iostream>

using namespace std;

int main() {
    int n, a, b, c, x, y;
    while (true) {
        cin >> n >> a >> b >> c >> x;
        if (n == 0) {
            break;
        }
        int frame = 0;
        for (; n>0; n--) {
            cin >> y;
            while (x != y) {
                frame++;
                x = (a*x+b)%c;
                if (frame > 10000) {
                    for (n--; n>0; n--) {
                        cin >> y;
                    }
                    frame = -1;
                    break;
                }
            }
            if (n > 1) {
                frame++;
                x = (a*x+b)%c;
            }
        }
        cout << frame << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
from itertools import product
n = int(input())
A = set()
for x in product('753_', repeat=9):
    s = ''.join(x)
    s = s.replace('_', '')
    if '7' in s and '5' in s and '3' in s and int(s) <= n:
        A.add(s)
print(len(A))

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

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

template <typename T> T id(T b) {return b;};
template <class It> bool all(It f,It l){return std::all_of(f,l,id<bool>);}
template <class It> bool any(It f,It l){return std::any_of(f,l,id<bool>);}
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}

const int MAX_HW = 10000;
int h,w;
string grid[MAX_HW];
int l[MAX_HW][MAX_HW];
int r[MAX_HW][MAX_HW];
int u[MAX_HW][MAX_HW];
int d[MAX_HW][MAX_HW];


int main()
{
#ifdef FASTIO
  ios_base::sync_with_stdio(false); cin.tie(nullptr);
#endif

  cin >> h >> w;
  forn(i,h) cin >> grid[i];

  int pos = 0;
  forn(i,h) {
    forn(j,w) {
      l[i][j] = pos;
      if (grid[i][j] == '#') pos = j+1;
    }
    pos = 0;
  }

  pos = w-1;
  forn(i,h) {
    for (int j = w-1; j >= 0; j--) {
      r[i][j] = pos;
      if (grid[i][j] == '#') pos = j-1;
    }
    pos = w-1;
  }

  pos = 0;
  forn(j,w) {
    forn(i,h) {
      u[i][j] = pos;
      if (grid[i][j] == '#') pos = i+1;
    }
    pos = 0;
  }

  pos = h-1;
  forn(j,w) {
    for (int i = h-1; i >= 0; i--) {
      d[i][j] = pos;
      if (grid[i][j] == '#') pos = i-1;
    }
    pos = h-1;
  }

  int res = 0;
  forn(i,h) forn(j,w)
    if (grid[i][j] == '.')
      chmax(res, (j-l[i][j]) + (r[i][j]-j) + (i-u[i][j]) + (d[i][j]-i));

  cout << res+1 << endl;

  return 0;
}


Measured memory_bytes: 322432
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define fi first
#define se second
#define endl "\n"
#define all(v) v.begin(),v.end()
#define fastio ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0)
#define go_t int t;cin>>t;for(int tt=1;tt<=t;tt++)
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define trace2(x, y)             cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)       cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;
typedef tree<pair<ll,ll>,null_type,less<pair<ll,ll>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; // order_of_key
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const ll inf = 0x3f3f3f3f3f3f3f3fll;//4x10e18
const int maxx = 3000000 , mod = 1000000007;
#define PI 3.14159265
int main()
{
    fastio;
    ll x;
    cin>>x;
    ll cur = 100;
    for(int i=1;;i++)
    {
        cur = cur + cur/100;
        if(cur>=x)
        {
            cout<<i;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 3640
input = gets.chomp.split().map(&:to_i)
s_h = input.first
s_m = input[1]
f_h = input[2]
f_m = input[3]
min = input.last

hour_min = (f_h - s_h)*60
hour_min += f_m - s_m

puts hour_min - min


Measured memory_bytes: 14376
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
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; }
typedef long long ll;
using namespace std;
int main(void){
    string s,t;cin>>s>>t;
    vector<vector<ll>> v(26);
    rep(i,s.size())v[s[i]-'a'].push_back(i+1);
    ll tmp1=0,tmp2=-1;
    rep(i,t.size()){
        int x=t[i]-'a';
        int sz=v[x].size();
        if(v[x].size()==0){
            cout<<-1<<endl;
            return 0;
        }
        if(v[x][sz-1]<=tmp2){
            tmp2=v[x][0];
            tmp1++;
            continue;
        }
        auto& vv=v[x];
        auto itr=upper_bound(vv.begin(),vv.end(),tmp2);
        int k=itr-vv.begin();
        ll y=v[x][k];
        tmp2=y;
    }
    ll res=tmp1*s.size()+tmp2;
    cout<<res<<endl;
}

Measured memory_bytes: 4648
#include <cstdio>

using namespace std;

int main(){
	int n,m,l,i,j,k,a[101][101],b[101][101];
long long int c;

	scanf("%d%d%d",&n,&m,&l);
	for(i=0; i<n; i++){
		for(j=0; j<m; j++) scanf("%d",&a[i][j]);
	}
	for(i=0; i<m; i++){
		for(j=0; j<l; j++) scanf("%d",&b[i][j]);
	}

	for(i=0; i<n; i++){
		for(j=0; j<l; j++){
			c=0;
			for(k=0; k<m; k++){
				c+=a[i][k]*b[k][j];
			}
			printf("%lld",c);
			if(j<l-1) printf(" ");
			else printf("\n");
		}
	}

	return 0;
}

Measured memory_bytes: 2780
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

int main(int argc, char *argv[])
{
	int dif;
	char f, s, t;
	char str1[16], str2[16], str3[16];
	cin >> str1 >> str2 >> str3;

	dif = 'A' - 'a';
	f = str1[0] + dif;
	s = str2[0] + dif;
	t = str3[0] + dif;

	cout << f << s << t;
	cout << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define repi(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define SIZE_OF_ARRAY(array)    (sizeof(array)/sizeof(array[0]))
typedef long long ll;
using namespace std;
int main(){
  string s;
  cin >> s;
  if(s.size()%2==1){
    cout << "No" << endl;
    return 0;
  }
  for(int i=0;i<s.size();i=i+2){
    if(s[i]!='h' ||  s[i+1]!='i'){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;

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 ll INF = 1e15;
const int MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll s; cin>>s;
  ll a=1e9;
  if(s<=a){
    cout<<0<<" "<<0<<" "<<1<<" "<<1<<" "<<1<<" "<<s+1<<endl;
  }else if(s<a*a){
    ll x=a-s%a;
    ll y=(s+x)/a;
    cout<<0<<" "<<0<<" "<<a<<" "<<1<<" "<<x<<" "<<y<<endl;
  }else{
    cout<<0<<" "<<0<<" "<<a<<" "<<0<<" "<<0<<" "<<a<<endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1003;
const int mod = 1e9 + 7;
int n, q,h,s,d;
int dx[] = { 0, 0, 1, -1 };
int dy[] = { 1, -1, 0, 0 };

int main() {
	//freopen("input.txt", "r", stdin);
	scanf("%d%d%d%d", &q, &h,&s,&d);
	scanf("%d",&n);
	h=min(h,2*q);
	s=min(s,2*h);
	if(2*s<=d){
		cout<<(ll) s*n;
	}
	else{
		ll tmp=n/2;
		cout<<(ll) (tmp*d+(n%2)*s);
	}

}



Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
using namespace std;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define REPR(i,n) for(ll i=n-1;i>=0;i--)

typedef long long ll;
#define INF 1e18

int main(){
	ll n; cin>>n;
	vector<ll> a(n);
	REP(i,n) cin>>a[i];
	sort(a.begin(),a.end());
	REP(i,n-1){
		if(a[i]==a[i+1]){
			cout<<"NO"<<endl;
			return 0;
		}
	}
	cout<<"YES"<<endl;
	return 0;
}


Measured memory_bytes: 1792
N, Y = gets.chomp.split.map(&:to_i)
Y /= 1000
ans = Array.new(3,-1)
for i in 0...N+1
  if ans[0] > 0
    break
  end
  for j in 0...N+1-i
    if ((Y-i*10-j*5) > N - i - j || (Y-i*10-j*5) < 0 || (Y-i*10-j*5) < N - i - j)
      next
    end
    ans = [i,j,Y-i*10-j*5]
    break
  end
end
puts ans.join(" ")

Measured memory_bytes: 1788
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
typedef complex<D> P;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;


template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,vector<T> &A){ll i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}
template<typename T>vector<T> & cset(vector<T> &A,T e=T()){for(auto &I:A){I=e;} return A;}

const ll NUM=26;
const ll SIZE=52;

ll cul(char c){return islower(c)?c-'a':c-'A'+NUM;}


int main(){
    string s;
    while(cin>>s,s[0]!='#'){
        ll N=s.size();
        vector<vector<bool>> A(SIZE,vector<bool>(SIZE));
        bool db=false;
        for(int i=1;i<N;i++){db|=A[cul(s[i-1])][cul(s[i])]; A[cul(s[i-1])][cul(s[i])]=true;}
        vector<ll> Icnt(SIZE,0),Ocnt(SIZE,0);
        ll rem=0,num=0,mx=0;
        for(int i=0;i<SIZE;i++){
            for(int j=0;j<SIZE;j++){
                num+=A[i][j];
                Icnt[j]+=A[i][j];
                Ocnt[i]+=A[i][j];
            }
        }
        for(int i=0;i<SIZE;i++){
            rem+=max(0LL,Icnt[i]-Ocnt[i]);
            mx=max(mx,Ocnt[i]);
            mx=max(mx,Icnt[i]);
        }
        ll B=cul(s[0]),G=cul(s.back());
        ll add=max(0LL,rem-1)+1;
        if(num+add<N){cout<<num+add<<endl;}
        else if(num<=1){cout<<"No Results"<<endl;}
        else if(db || mx>2 || B==G || Ocnt[G]>1 || Icnt[B]>1){cout<<N<<endl;}
        else{
            function<bool(int,int)> check=[&](int w,int p){
                vector<bool> used(SIZE,false);
                used[p]=true;
                used[w]=true;
                stack<int> S;
                S.push(w);
                while(!S.empty()){
                    w=S.top(); S.pop();
                    if(w==G){return true;}
                    for(int j=0;j<SIZE;j++){
                        if(!used[j] && A[w][j]){S.push(j); used[j]=true;}
                    }
                }
                return false;
            };
            mx=0;
            for(int i=0;i<SIZE;i++){
                int cnt=0;
                for(int j=0;j<SIZE;j++){
                    if(i!=j && A[i][j] && check(j,i)){cnt++;}
                }
                mx=max<ll>(mx,cnt);
            }
            cout<<(mx>=2?N:N+1)<<endl;
        }
    }
    
    
    return 0;
}



Measured memory_bytes: 3108
fun main(args: Array<String>) {
    val (n, h) = readLine()!!.split(" ").map(String::toInt)
    val aArray = Array(n, {0})
    val bArray = Array(n, {0})
    for (i in 0 until n) {
        val(a, b) = readLine()!!.split(" ").map(String::toInt)
        aArray[i] = a
        bArray[i] = b
    }
    val aMax = aArray.max()!!
    val filteredBArray = bArray.filter { it > aMax }.sortedDescending()

    var ans = 0
    var acc = 0
    for (b in filteredBArray) {
        acc += b
        ans += 1
        if (acc >= h) {
            println(ans)
            return
        }
    }
    println(ans + (h - acc + aMax - 1) / aMax)
}

Measured memory_bytes: 58492