akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cmath>
using namespace std;
int main() {
    int n;
    cin >> n;
    int d[3] = {3, 5, 7};
    int ans = 0;
    for (int i = 3; i < 10; i++) { //333から大きくしていく感じ　ここで桁が決まります
        for (int bit = 0; bit < pow(3, i); bit++) { //ある桁のとき何数見ますか
            //以下、どうやって3,5,7の3進作りますか
            int a = 0, p = bit;
            for (int j = 0; j < i; j++) { //よっしゃ、各桁の数決めまっせ
                a += d[p % 3] * pow(10, j);
                p /= 3; //p=1だったら2桁目はd[0]の3が入る p=26だったら1桁目2でp=8,2桁目2でp=2,3桁目2
            }
            //cout << a << endl;
            if (a > n || a == 777777777) { //777777778以上だと出力なしで終了する
                cout << ans << endl;
                return 0;
            }
            //ans++なのは3,5,7 1つ以上いる
            int check[3] = {0};
            while (a != 0) {
                if (a % 10 == 3) check[0]++;
                else if (a % 10 == 5) check[1]++;
                else check[2]++;
                a /= 10;
            }
            if (check[0] >= 1 && check[1] >= 1 && check[2] >= 1) {
                ans++;
            }
            for (int j = 0; j < 3; j++) {
                check[j] = 0;
            }
        }
    }
}


Measured memory_bytes: 256
//url:
//problem name: 

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
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;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    cout << ((c >= a && c <= b) ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <limits>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using namespace boost;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

int main() {
uint n, m;
cin >> n >> m;
n--;m--;
cout << n*m;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
S = list(input())

ans = S.count('R')*S.count('G')*S.count('B')

for i in range(N):
  for j in range(i+1, N):
    k = j + j - i
    if k < N :
      if (S[i] != S[j]) and (S[j] != S[k]) and (S[k] != S[i]) :
        ans -= 1

print(ans)

Measured memory_bytes: 9208
H, W, K = map(int, input().split())

c = []
b_h = [0] * H
b_w = [0] * W
b = 0

for h in range(H):
    c.append(input().rstrip())
    for w in range(W):
        if c[h][w] == "#":
            b_h[h] += 1
            b_w[w] += 1
            b += 1

ans = 0
for hi in range(2 ** H):
    for wi in range(2 ** W):
        bsum = b

        for h in range(H):
            if hi & (2 ** h) != 0:
                bsum -= b_h[h]
                for w in range(W):
                    if wi & 2 ** w != 0:
                        if c[h][w] == '#':
                            bsum += 1

        for w in range(W):
            if wi & (2 ** w) != 0:
                bsum -= b_w[w]

        if bsum == K:
            ans += 1

print(ans)


Measured memory_bytes: 9100
#include <bits/stdc++.h>
using namespace std;
#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 rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = LLONG_MAX;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
int main() {
    string s;
    cin >> s;
    ll k;
    cin >> k;
    int i = 0;
    for(;i<s.size()&&s[i]=='1';i++);
    if(i>=k) cout << 1 << endl;
    else cout << s[i] << endl;
    // cout << i << endl;
    return 0;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,j,ac,wa,tle,re;
    scanf("%d", &n);
    char s[10001];

     int l=strlen(s);
        ac=wa=tle=re=0;

        for(i=0;i<n;i++){
            scanf("%s", s);
        if(strcmp(s,"AC")==0)
            ac++;
        else if(strcmp(s,"WA")==0)
            wa++;
        else if(strcmp(s,"RE")==0)
            re++;
        else{
            tle++;
        }

        }
        printf("AC x %d\n", ac);
        printf("WA x %d\n", wa);
        printf("TLE x %d\n", tle);
        printf("RE x %d", re);
}


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

#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;
 
const ll INF = 1LL<<60;
const int MINF = 1e9;
const int MOD = 1e9+7;

using vi = vector<int>;
using vii = vector<vi>;

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

template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

int main(){
    double h,a;cin >> h >> a;
    cout << ceil(h/a) << endl;
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include <queue>
#include <utility>
#include <map>
#include <set>
#include <deque>
#include <numeric>
using namespace std;

int main() {
    int N, a = 0, b = 0;
    cin >> N;
    vector<int>A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end());

    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) {
            a += A.back();
            A.pop_back();
        }
        else {
            b += A.back();
            A.pop_back();
        }
    }

    cout << a - b << endl;

    return 0;
}

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

public class Main {
    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int N = fs.nextInt();
        int sho;
        int amari;
        int cnt = 0;
        for(int i=1; i<10; i++ ) {
            sho = N/i;
            amari = N%i;
            if(amari == 0) {
                if(!(sho<=9)) cnt++;
            }else cnt++;
        }
        if(cnt == 9) {
            System.out.println("No");
        }else System.out.println("Yes");
    }
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
 
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
 
    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }
 
    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
 
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }
 
    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
 
    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
 
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

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

    int ans=0, tmp;

    vector<lint> a(n),b(n),c(n-1);
    REP(i, n) { cin >> a[i]; }
    REP(i, n) { cin >> b[i]; }
    REP(i, n-1) { cin >> c[i]; }

    int dish;
    REP(i, n) {
        dish = a[i];
        ans += b[dish-1];
        if(i!=n-1&&a[i+1]==dish+1){
            ans += c[dish-1];
        }


    }

    cout << ans <<"\n";

    return 0;
}

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

const int SIZE = 30;
int h, w;
string m[SIZE];

bool input() {
  if (cin >> h >> w) {
    for (int i = 0; i < h; ++i) {
      cin >> m[i];
    }
    return true;
  }
  return false;
}

typedef tuple<int, int, int> node_t; // (steps, r, c)
typedef priority_queue<node_t, vector<node_t>, greater<node_t>> queue_t;

queue_t q;
const int dr[4] = {1, -1, 0, 0};
const int dc[4] = {0, 0, 1, -1};
const char START = 'S';
const char GOAL = 'G';
int mc[SIZE][SIZE];

bool outer(int r, int c) {
  return r < 0 || r >= h || c < 0 || c >= w;
}

bool invalid(int r, int c) {
  return m[r][c] == '#' || m[r][c] == 'x';
}

bool ok(int r, int c) {
  return m[r][c] == 'o';
}

bool goal(int r, int c) {
  return m[r][c] == GOAL;
}

void push(const node_t& node) {
  auto steps = get<0>(node);
  auto r = get<1>(node);
  auto c = get<2>(node);
  if (steps >= mc[r][c]) return;
  mc[r][c] = steps;
  q.push(node);
}

int solve() {
  int sr, sc;
  sr = sc = -1;
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (m[i][j] == START) {
        sr = i;
        sc = j;
      }
    }
  }
  assert(sr != -1);
  assert(sc != -1);
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      mc[i][j] = numeric_limits<int>::max();
    }
  }

  q = queue_t();
  q.emplace(0, sr, sc);

  while (!q.empty()) {
    node_t node = q.top();
    q.pop();

    auto steps = get<0>(node);
    auto r = get<1>(node);
    auto c = get<2>(node);

    if (goal(r, c)) return steps;

    // normal
    for (int k = 0; k < 4; ++k) {
      auto nr = r + dr[k];
      auto nc = c + dc[k];
      if (outer(nr, nc) || invalid(nr, nc)) continue;
      auto nsteps = steps + (ok(nr, nc) ? 1 : 2);
      push(node_t(nsteps, nr, nc));
    }

    // paint
    for (int k = 0; k < 4; ++k) {
      for (int i = 1; i <= 3; ++ i) {
        auto nr = r + dr[k] * i;
        auto nc = c + dc[k] * i;
        if (outer(nr, nc)) break;
        if (m[nr][nc] == '#') break;
        auto nsteps = steps + 2 + i;
        push(node_t(nsteps, nr, nc));
      }
    }
  }

  return -1;
}

int main() {
  while (input()) cout << solve() << endl;
  return 0;
}

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

using namespace std;

class SegmentTree {
public:
  SegmentTree(const vector<long long> &a) : n(a.size()) {
    int size = 2 * pow(2.0, floor(log2(double(n))) + 1);
    rmq.assign(size, 0);
    Build(a, 1, 0, n);
  }
  long long Query(int ql, int qr) {
    return Query(1, 0, n, ql, qr);
  }
private:
  void Build(const vector<long long> &a, int id, int l, int r) {
    if (l + 1 == r) {
      rmq[id] = a[l];
    } else {
      int mid = (l + r) / 2;
      Build(a, 2 * id, l, mid);
      Build(a, 2 * id + 1, mid, r);
      rmq[id] = max(rmq[2 * id], rmq[2 * id + 1]);
    }
  }
  long long Query(int id, int l, int r, int ql, int qr) {
    if (l == ql && r == qr) {
      return rmq[id];
    }
    int mid = (l + r) / 2;
    if (qr <= mid) {
      return Query(2 * id, l, mid, ql, qr);
    } else if (ql >= mid) {
      return Query(2 * id + 1, mid, r, ql, qr);
    }
    return max(Query(2 * id, l, mid, ql, mid), Query(2 * id + 1, mid, r, mid, qr));
  }
  int n;
  vector<long long> rmq;
};

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

  int n;
  long long c;
  cin >> n >> c;

  vector<pair<long long, long long>> sushi(n);
  for (int i = 0; i < n; ++i) {
    cin >> sushi[i].first >> sushi[i].second;
  }

  long long max_diff = 0;

  vector<long long> left_cum(n), left_diff(n);
  left_cum[0] = sushi[0].second;
  for (int i = 1; i < n; ++i) {
    left_cum[i] = left_cum[i-1] + sushi[i].second;
  }
  for (int i = 0; i < n; ++i) {
    left_diff[i] = left_cum[i] - sushi[i].first;
    max_diff = max(max_diff, left_diff[i]);
  }

  vector<long long> right_cum(n), right_diff(n);
  right_cum[n-1] = sushi[n-1].second;
  for (int i = n - 2; i >= 0; --i) {
    right_cum[i] = right_cum[i+1] + sushi[i].second;
  }
  for (int i = n - 1; i >= 0; --i) {
    right_diff[i] = right_cum[i] - c + sushi[i].first;
    max_diff = max(max_diff, right_diff[i]);
  }

  SegmentTree left_st(left_diff), right_st(right_diff);
  for (int i = 0; i < n - 1; ++i) {
    max_diff = max(max_diff, left_diff[i] + right_st.Query(i + 1, n) - sushi[i].first);
  }
  for (int i = n - 1; i > 0; --i) {
    max_diff = max(max_diff, right_diff[i] + left_st.Query(0, i) - c + sushi[i].first);
  }

  cout << fixed << max_diff << endl;

  return 0;
}


Measured memory_bytes: 9088
#include <bits/stdc++.h>
using namespace std;
int main(){
	int N, M; 
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0); 
	cin >> N >> M; 
	if(N == 4){
		cout << 1 << " " << 2 << endl; return 0; 
	}
	if(N % 2){
		for(int i = 1; i <= M; i++){
			cout << i << " " << N + 1 - i << "\n"; 
		}
	}else{
		for(int i = 1; i <= M; i++){
			cout << i << " " << (i > N/4 ? N - i : N + 1 - i) << "\n"; 
		}
	}
}

Measured memory_bytes: 3656
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <limits>
#include <numeric>
#include <cmath>

using namespace std;

template<class T>
class Input {
public:
    auto operator()() const {
        T v;
        cin >> v;
        return v;
    }
};

template<class L, class R>
class Input<pair<L, R>> {
public:
    auto operator()() const {
        L l;
        R r;
        cin >> l >> r;
        return make_pair(l, r);
    }
};

template<class U>
class Input<vector<U>> {
public:
    auto operator()() const {
        Input<size_t> in{};
        auto n = in();
        return (*this)(n);
    }
    auto operator()(size_t n) const {
        vector<U> v;
        v.reserve(n);
        Input<U> in{};
        for (size_t i = 0; i < n; ++i) {
            auto u = in();
            v.emplace_back(move(u));
        }
        return v;
    }
};

template<class U>
class Input<vector<vector<U>>> {
public:
    auto operator()() const {
        Input<size_t> in{};
        auto n = in();
        auto m = in();
        return (*this)(n, m);
    }
    auto operator()(size_t n, size_t m) const {
        vector<vector<U>> v;
        v.reserve(n);
        Input<vector<U>> in{};
        for (size_t i = 0; i < n; ++i) {
            auto u = in(m);
            v.emplace_back(move(u));
        }
        return v;
    }
};

class InputType
{
public:
    template<class T>
    operator T() const {
        Input<T> i{};
        return i();
    }
};

class InputType2
{
public:
    InputType2(size_t n)
        : n_(n)
    {}
    template<class T>
    operator T() const {
        Input<T> i{};
        return i(n_);
    }
private:
    size_t n_;
};

auto input() {
    return InputType();
}

template<class... Args>
auto input(Args&&... args) {
    return InputType2(std::forward<Args>(args)...);
}

size_t bitcount(size_t n) {
    size_t c = 0;
    while (n) {
        if (n & 1ull)
            ++c;
        n >>= 1;
    }
    return c;
}

auto make_order(size_t n) {
    vector<size_t> a(n, 0);
    iota(begin(a), end(a), 0);
    return a;
}

template<class T>
auto next_permutation(T&& x) {
    using std::begin;
    using std::end;
    return next_permutation(begin(x), end(x));
}

using ll = long long;
using ull = unsigned long long;

int main() {
    size_t x = input();
    size_t y = input();
    size_t z = input();
    cout << z << ' ' << x << ' ' << y << endl;
    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for i in range(n):
    if a[i] >= b[i]:
        ans += b[i]
    else:
        enemies = a[i] + a[i+1]
        if enemies >= b[i]:
            ans += b[i]
            a[i+1] = a[i] + a[i+1] - b[i]
        else:
            ans += enemies
            a[i+1] = 0
print(ans)


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

int main() {
  int A, B;
  cin >> A >> B;
  
  int cons = 1;
  int tap = 0;
  while (cons < B) {
    cons += A - 1;
    tap++;
  }
  
  cout << tap << endl;
}
    

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		String s=sc.next();
		int[][] dp=new int[n+1][n+1];
		int ans=0;
		for(int i=n-1; i>=0; i--){
			for(int j=i-1; j>=0; j--){
				if(s.charAt(i)==s.charAt(j)){
					dp[i][j]=dp[i+1][j+1]+1;
				}
				ans=Math.max(ans,Math.min(dp[i][j],i-j));
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 168724
#include <iostream>
#include <cmath>
#define inf 100000000000000000
#define llint long long

using namespace std;

int n;
int a[100005];

int main(void)
{
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> a[i];
	llint ans = inf, cnt, sum, dif;
	
	cnt = 0, sum = 0; 
	for(int i = 1; i <= n; i++){
		dif = 0;
		sum += a[i];
		if(i % 2 && sum <= 0) dif = 1 - sum;
		if(i % 2 == 0 && sum >= 0) dif = -1 - sum;
		cnt += abs(dif);
		sum += dif;
	}
	ans = min(ans, cnt);
	
	for(int i = 1; i <= n; i++) a[i] *= -1;
	
	cnt = 0, sum = 0, dif; 
	for(int i = 1; i <= n; i++){
		dif = 0;
		sum += a[i];
		if(i % 2 && sum <= 0) dif = 1 - sum;
		if(i % 2 == 0 && sum >= 0) dif = -1 - sum;
		cnt += abs(dif);
		sum += dif;
	}
	ans = min(ans, cnt);
	
	cout << ans << endl;
	return 0;
}

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

using namespace std;

int main() {
	int N;
	
	cin >> N;
	
	string slime;
	
	cin >> slime;
	
	int count_slime = 1;
	
	for(int i = 0; i < N-1; i++) {
		if(slime.at(i) != slime.at(i+1)) {
			count_slime += 1;
		}
	}
	
	cout << count_slime << '\n';
	
	return 0;
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  while(true){
    C=C-B;
    if(C<=0){
      cout << "Yes" <<endl;
      break;
    }
    A=A-D;
    if(A<=0){
      cout << "No" <<endl;
      break;
    }
  }
  return 0;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define Rep(i, N) for(int i = 0; i < N; i++) 
int main()
{
    int N;
    string S, T = "JOI";
    int dp[1006][8] = {};
    cin >> N >> S;
    dp[0][1] = 1;
    Rep(i, N) Rep(j, 8) Rep(k, 8) if(k & j && (1 << T.find(S[i])) & k) (dp[i + 1][k] += dp[i][j]) %= 10007;
    cout << accumulate(dp[N], dp[N + 1], 0) % 10007 << endl;
    return (0);
}


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

using namespace std;

typedef long long int ll;

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

typedef pair<int,int> pair;

int main(){
    string s,t;
    cin >> s >> t;
    cout << t+s << endl;
}

Measured memory_bytes: 256
var input = ""
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});

process.stdin.on('end', function() {
  input = input.split("\n");
  i = 0
  while (input[i] != 0) {
    arr = input[i].split(" ");
    sum = 0;
    arr[0] = Number(arr[0]);
    arr[1] = Number(arr[1]);
    arr[2] = Number(arr[2]);

    for (j = arr[0]; j <= arr[1]; j++) {
      if (arr[2] % j == 0) {
        sum++
      }
    }
    console.log(sum);
    i++;
  }
});

Measured memory_bytes: 7648
/* Author: Dhruv Rastogi */
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<int, int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int> 
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second
const long double PI = acos(-1.0);

void solve(){  
	int n;
	cin>>n;
	cout<<fixed<<setprecision(12)<<((n+1)/2)*1.0/n<<endl;  
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

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

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
typedef double              DOUBLE;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

using namespace std;

vector<SINT32> KAZU(10);
vector<SINT32> POI(10);
vector<SINT32> MAXPOI(10);

SINT32 N = 0;
SINT32 G = 0;
int dfs(SINT32 depth, vector<SINT32> SERCH);

int main() {

	cin >> N;
	cin >> G;

	SINT32 cnt = 0;

	vector<SINT32> SERCH(10);
	
	for (SINT32 i = 0; i < N; i++) {
		cin >> KAZU[i];
		cin >> POI[i];
		MAXPOI[i] = KAZU[i] * 100*(i+1) + POI[i];
	}

	cnt = dfs(0, SERCH);

	cout << cnt << endl;
	return 0;
}

int dfs(SINT32 depth, vector<SINT32> SERCH) {

	SINT32 cnt = 1000000001;
	SINT32 sum = 0;
	SINT32 buf_cnt = 0;
	SINT32 buf_max = 0;
	if (depth == N) {
		for (SINT32 i = 0; i < N; i++) {
			if (SERCH[i] == 1) {
				sum = sum + MAXPOI[i];
				buf_cnt = buf_cnt + KAZU[i];
			} else {
				buf_max = i;
			}
		}
		if (G <= sum) {
			return buf_cnt;
		}

		for (SINT32 i = 0; i < KAZU[buf_max]; i++) {
			buf_cnt++;
			sum = sum + (buf_max+1)*100;
			if (G <= sum) {
				return buf_cnt;
			}
		}
		return cnt;
	}

	
	SERCH[depth] = 0;
	cnt = dfs(depth + 1, SERCH);

	SERCH[depth] = 1;
	cnt = MIN(cnt,dfs(depth + 1, SERCH));

	return cnt;
}

//	sort(DATA.begin(),DATA.end());
//	sort(DATA.begin(),DATA.end(),std::greater<SINT32>());
//	__gcd(ANS,DATA[i]);

//	// DATA.emplace_back(BUF);	//後ろに追加

//  DATA.erase(std::unique(DATA.begin(), DATA.end()), DATA.end());

/*
	SINT32 M = 3;
	vector<pair<SINT32,SINT32>> DATA2(M);
	for (SINT32 i = 0; i < M; i++) {
		cin >> DATA2[i].first;
		cin >> DATA2[i].second;
	}
	sort(DATA2.begin(),DATA2.end());
	cout << DATA2[0].first << endl;
	cout << DATA2[0].second << endl;
*/

//		APOSI = lower_bound(ADATA.begin(),ADATA.end(),QDATA[i]) - ADATA.begin();
//		BPOSI = lower_bound(BDATA.begin(),BDATA.end(),QDATA[i]) - BDATA.begin();

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <climits>
#include <numeric>
#include<stdio.h>
#include <queue>
#include <iomanip>
#include <float.h>
#include <set>
#include<functional>
#include <stack>
#include <time.h>
#include <climits>
#include <bitset>
#include <cmath>
using namespace std;
long long gcd(long long a, long long b) {
	if (a < b) gcd(b, a);
	long long  r;
	while ((r = a%b)) {
		a = b;
		b = r;
	}
	return b;
}
long long lcm(long long a, long long b) {
	return a / gcd(a, b) * b;
}
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

long long modinv(long long a, long long mod) {
	long long b = mod, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t*b; swap(a, b);
		u -= t*v; swap(u, v);
	}
	u %= mod;
	if (u < 0) u += mod;
	return u;
}
inline long long mod(long long a, long long m) {
	return (a % m + m) % m;
}

// 拡張 Euclid の互除法
// ap + bq = gcd(a, b) となる (p, q) を求め、d = gcd(a, b) をリターンします
long long extGcd(long long a, long long b, long long &p, long long &q) {
	if (b == 0) { p = 1; q = 0; return a; }
	long long d = extGcd(b, a%b, q, p);
	q -= a / b * p;
	return d;
}

// 中国剰余定理
// リターン値を (r, m) とすると解は x ≡ r (mod. m)
// 解なしの場合は (0, -1) をリターン
//amari,mod,amari,mod
pair<long long, long long> ChineseRem(long long b1, long long m1, long long b2, long long m2) {
	long long p, q;
	long long d = extGcd(m1, m2, p, q); // p is inv of m1/d (mod. m2/d)
	if ((b2 - b1) % d != 0) return make_pair(0, -1);
	long long m = m1 * (m2 / d); // lcm of (m1, m2)
	long long tmp = (b2 - b1) / d * p % (m2 / d);
	long long r = mod(b1 + m1 * tmp, m);
	return make_pair(r, m);
}
typedef pair<long long,long long>p;
#define int long long
signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	int a[200004];
	int b[200004];
	int bb[200004];
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int j = 0; j < n; j++) {
		cin >> b[j];
	}
	for (int t = 29; t >= 0; t--) {
		long long k = 1;
		for (int i = 0; i < t; i++) {
			k *= 2;
		}
		for (int i = 0; i < n; i++) {
			bb[i] = b[i] % (k*2);
			a[i] %= (k * 2);
		}
		sort(bb, bb + n);
		bb[n] = LLONG_MAX;
		long long cnt = 0;
		if (t == 0) {
			int x = 10;
		}
		for (int i = 0; i < n; i++) {
			cnt += lower_bound(bb, bb + n+1, 2*k - a[i]) - lower_bound(bb, bb + n+1,  k - a[i]);
			cnt %= 2;
			cnt += lower_bound(bb, bb + n+1, k * 4 - a[i]) - lower_bound(bb, bb + n+1, 3 * k - a[i]);
			cnt %= 2;
		}
		ans += (cnt % 2)*k;
	}
	cout << ans;
}


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

int main(){
  long int x;
  cin >> x;
  long int sum=0;
  int a,b;
  a = (x/500);
  b = (x-(x/500)*500)/5;
  sum += 1000*a;
  sum += 5*b;
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline

# A - Digits Sum
def digits_sum(num):
	sum = 0
	
	for s in str(num):
		sum += int(s)
	
	return sum


N = int(input())
ans = sys.maxsize

if N < 10:
	max_index = N
else:
	max_index = N // 2

for A in range(1, max_index):
	B = N - A
	sum = digits_sum(A) + digits_sum(B)
	ans = min(ans, sum)
	
print(ans)

Measured memory_bytes: 3064
#include <stdio.h>
#include <string.h>

int main(){
    char s[101], p[101], t[201];
    
    scanf("%s", s);
    scanf("%s", p);
    
    strcpy(t, s);
    strcat(t, s);
    if (strstr(t, p) != NULL)
      printf("Yes\n");
    else
      printf("No\n");
      
    return 0;
}


Measured memory_bytes: 2100
#include "bits/stdc++.h"
#define esc(ret) cout << ret << endl,quick_exit(0)
#define fcout(d) cout << fixed << setprecision(d)
#define repU(i,s,t) for(int i = (int)(s); i <= (int)(t); ++i)
#define repD(i,t,s) for(int i = (int)(t); i >= (int)(s); --i)
#define rep(i,n) repU(i,0,n - 1)
#define rep1(i,n) repU(i,1,n)
#define all(v) begin(v),end(v)
#define vct vector
#define prique priority_queue
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define qceil(n,d) ((n) > 0 ? ((n) - 1) / (d) + 1 : (n) / (d))
#define parity(a,b) (a & 1 == b & 1)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;

const pii dir[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int inf32 = (1 << 30) - 1;
const ll inf64 = (1LL << 62) - 1;
const int mod = 1e9 + 7;

ll K;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> K;
	cout << 50 << endl;
	ll q = K / 50,r = K % 50;
	ll a = q + 49;
	for(int i = 0; i < r; ++i){
		cout << a + 51 - r << ' ';
	}
	for(int i = r; i < 50; ++i){
		cout << a - r << ' ';
	}
	cout << endl;
}



Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();

    int min = a+b;
    min = Math.min(min,b+c);
    min = Math.min(min,c+a);
    System.out.println(min);
  }
}


Measured memory_bytes: 25044
#include <bits/stdc++.h>
#define maxn 200005
#define MOD 1000000007
#define INF 10000000000

using namespace std;

#define ll long long
#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second

void fast(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

void solve(){

    ll n;
    cin >> n;
    ll a[n];
    map<ll, ll> mp1, mp2;
    for(ll i = 0 ; i< n; i++){
        cin >> a[i];
        mp1[a[i]]++;
    }
    ll ans = 0;
    for(ll i = 0 ; i< n; i++){
        if(mp2[a[i]]){}
        else{
            mp2[a[i]]++;
            ans += (mp1[a[i]]* (mp1[a[i]]-1))/2;
        }
    }
    for(ll i = 0 ; i< n; i++){
        if(mp1[a[i]] > 1){
            cout << ans - (mp1[a[i]]* (mp1[a[i]]-1))/2 + ((mp1[a[i]]-1)* (mp1[a[i]]-2))/2<< "\n";
        }
        else cout << ans << "\n";
    }

}

int main()
{
    fast();
    int t= 1;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 18944
import java.util.Scanner;

public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int a,b,c;
        a = scan.nextInt(); b = scan.nextInt(); c=scan.nextInt();
        if  (a<b && b<c){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}


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

int main() {
	ll a, v, b, w, t;
	cin >> a >> v >> b >> w >> t;
	string ans = "NO";
	ll axmin = a - v * t;
	ll axmax = a + v * t;
	ll bxmin = b - w * t;
	ll bxmax = b + w * t;
	if (axmin <= bxmin && axmax >= bxmax) ans = "YES";
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define dcout cout << fixed << setprecision(15)
#define rep(i, a) for(int i = 0; i < a; i++)
#define arep(i, x) for(auto i : x)
#define all(v) v.begin(), v.end()
#define int long long
#define F first
#define S second
#define VE vector<int>
#define pb(x) push_back(x)
using namespace std;
signed main() {
    int n;
    cin >> n;
    int a[2][n];
    rep(i, 2) rep(j, n) {
        cin >> a[i][j];
    }
    int ans = 0;
    int max = 0;
    rep(i, n) {
        rep(j, i + 1) {
            ans += a[0][j];
        }
        rep(j, n - i) {
            ans += a[1][i + j];
        }
        if(max < ans) max = ans;
        ans = 0;
    }
    cout << max << endl;
    return 0;
}

Measured memory_bytes: 256
def count(l):
    res = {'W':0, 'R':0}
    for d in l:
        if d in res:
            res[d] += 1
        else:
            res[d] = 1
    return res
n = int(input())
string = input()
cnt = count(string)
swap = 0
for i in range(cnt['R']):
    if string[i] == 'W':
        swap += 1
print(min(swap, cnt['R'], cnt['W']))


Measured memory_bytes: 9500
import math
n=int(input())
x=[]
for _ in range(n):
    a,b=map(int, input().split())
    x.append([a,b])

l=0
for i in range(n):
    for j in range(n):
        l+=math.sqrt((x[i][0]-x[j][0])**2+(x[i][1]-x[j][1])**2)
print(l/n)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int n;
int frogA(int ind, int a[],vector<int>&dp){
	if(ind == n-1)return 0;
	if(dp[ind]!=-1)return dp[ind];
	int c1 = abs(a[ind] - a[ind+1]) + frogA(ind+1,a,dp);
	int c2 = INT_MAX;
	if(ind+2 <= n-1){
		c2 = abs(a[ind] - a[ind+2]) + frogA(ind+2,a,dp);
	}
	
	return dp[ind] = min(c1,c2);
	
}



int main(){
	

	cin >> n;
	int a[n];
	vector<int>dp(n,-1);
	for(int i = 0;i<n;i++)cin >>a[i];
	
	cout << frogA(0,a,dp);
	
}

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

int main(){
    long long n;
    cin>>n;
    string ans= "";
    
    while(n){
        ans += (char)('a'+ ((n-1)%26));
        if(n%26 != 0)n /= 26;
        else{
            n/=26;
            n--;
        }
    }

    reverse(ans.begin(),ans.end());
    cout<<ans<<endl;
}

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

#define fori( tt,aa)      for(long long i= tt; i<aa; i++)
#define forj( yy,bb)      for(long long j=yy; j<bb; j++)
#define fork( uu,cc)      for(long long k=uu; k<cc; k++)
#define sz(v)    v.size()
#define all(v)   v.begin(), v.end()
#define endl "\n";
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define EPS 1e-7
#define F first
#define S second
#define THINK_TWICE_CODE_ONCE; fast();

typedef long long ll;
typedef long double ld;
typedef double dd;
typedef string String;
typedef string str;
typedef vector<int> vecint;
typedef vector<ll> vecll;
typedef pair<int, int> pii;

void fast(){
    cin.tie(0);
    cout.tie(0);
    cin.sync_with_stdio(0);
}

ld pow (ll a, ll b);
ll numOfDigits(ll n);
ll BN (ll arr[], ll j, ll val);
int X, X1, Y, Y1;
int main()
{
    THINK_TWICE_CODE_ONCE;
    //freopen("test cases\\Snuke's Coloring 2.txt", "r", stdin);
    int w, h, n; cin>>w>>h>>n;
    X1 = w, Y1 = h;
    fori(0,n){
        int x, y, a; cin>>x>>y>>a;
        if(x<X) x = X;
        else if(x>X1) x = X1;
        if(y<Y) y = Y;
        else if(y>Y1) y = Y1;
        switch(a){
            case 1:
                    X = x;
                    break;
            case 2:
                    X1 = x;
                    break;
            case 3:
                    Y = y;
                    break;
            case 4:
                    Y1 = y;
                    break;
        }
    }
    cout<<abs(X-X1)*abs(Y-Y1);
    return 0;
}
ld pow (ll a, ll b){
    ld pow = 1;
    fori(0,b)
        pow *=a;
    return pow;
}
/*
ll BN (ll arr[], ll j, ll val){
int low = j;
int up = n-1;
ll ans = -1;
while(low<=up){
    ll mid = ((ll)low+ up)/2;
    if(abs(arr[mid]-val)<d){
        ans = mid;
        low = mid+1;
    }else up = mid-1;
}
return ans;
}*/

ll numOfDigits(ll n){
    if(!n) return 1;
    return (ll)(log10(n)+1);
}


Measured memory_bytes: 256
import collections
n, p = list(map(int, input().split()))
a = list(map(int, input().split()))
a2 = [ai%2 for ai in a]
a2 = collections.Counter(a2)

if p == 0:
  if a2[1] == 0:
    print(2 ** n)
  else:
    print(2 ** (n - 1))
    
else:
  if a2[1] == 0:
    print(0)
  else:
    print(2 ** (n-1))



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

int main(void){
  int c;
  while(cin >> c){
    int cnt = 0;
    for(int i = 0; i < 10; i++)
      for(int j = 0; j < 10; j++)
	for(int k = 0; k < 10; k++)
	  for(int l = 0; l < 10; l++)
	    if(i + j + k + l == c)
	      cnt++;
    cout << cnt << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n = I()
    b = LI()
    ans = []
    for j in range(n):
        for i in range(len(b))[::-1]:
            if b[i] == i+1:
                x = b.pop(i)
                ans.append(x)
                break
    if b:
        print(-1)
    else:
        print(*ans[::-1],sep = "\n")
    return

#B
def B():
    n,a,b,c,d = LI()
    s = S()
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    k = b
    while b < d:
        if s[b+1] == ".":
            b += 1
        else:
            if s[b+2] == "#":
                print("No")
                return
            b += 2
    b = k
    if c < d:
        while a < c:
            if s[a+1] == ".":
                a += 1
            else:
                if s[a+2] == "#":
                    print("No")
                    return
                a += 2
        print("Yes")
    else:
        for i in range(b-1,d):
            if s[i:i+3].count(".") == 3:
                print("Yes")
                return
        print("No")
    return

#C
def C():
    n,a,b,c,d = LI()
    if abs(b-a) > (n-1)*d:
        print("NO")
        return
    if 2*c <= (n-1)*(d-c):
        print("YES")
        return
    mi = a-(n-1)*d
    m = c+d
    f = 1+(n-1)*(d-c)
    if f >= m:
        print("YES")
        return
    if (b-mi)%m < f:
        print("YES")
    else:
        print("NO")
    return

#D
def D():
    s = S()
    n = len(s)
    ans = 0
    for i in range(n):
        if s[i] == "U":
            ans += n-i-1
            ans += 2*i
        else:
            ans += 2*(n-i-1)
            ans += i
    print(ans)
    return

#E
def E():
    n = I()
    a = LI()
    a.sort()
    b = [a[i] for i in range(n)]
    for i in range(n-1):
        b[i+1] += b[i]
    for i in range(n-1)[::-1]:
        if a[i+1] > 2*b[i]:
            break
    else:
        print(n)
        return
    print(n-i-1)
    return

#F
def F():
    n,k = LI()
    a = LI()
    b = [a[i] for i in range(n)]
    b.append(0)
    for i in range(n)[::-1]:
        b[i] += b[i+1]
    l = [0]*(n+1)
    for i in range(n):
        if a[i] > 0:
            l[i+1] += a[i]
        l[i+1] += l[i]

    r = [0]*(n+1)
    for i in range(n)[::-1]:
        if a[i] > 0:
            r[i] += a[i]
        r[i] += r[i+1]
    ans = -float("inf")
    for i in range(n-k+1):
        j = i+k
        ans = max(ans, l[i]+r[j]+max(0,b[i]-b[j]))
    print(ans)
    return

#Solve
if __name__ == "__main__":
    F()


Measured memory_bytes: 67748
#include<bits/stdc++.h>
#define FOR(i,a,b) for(long long int i=a;i<b;++i) 
#define ROF(i,a,b) for(long long int i=a;i>=b;--i)
#define vi vector<int>
#define vlli vector<long long int>
#define pb push_back
#define mp make_pair
#define all(c)  ((c).begin()), ((c).end())
using namespace std;
int MAX=1e6+1;
long long pow(long long i, long long a){
	long long prod=1;
	FOR(j,0,a)
		prod*=i;
	return prod;
}
int main(){
	ios::sync_with_stdio(0);
	long long p,n;
	cin>>n>>p;
	vi s(MAX);
	FOR(i,2,MAX){
		if(!s[i])
			for(int j=2*i;j<MAX;j+=i)
				s[j]=1;
	}
	long long prod=1;
	FOR(i,2,MAX){
		if(!s[i]){
			long long int c=0;
			long long int tp=p;
			while(tp!=1&&tp%i==0){
				c++;
				tp/=i;
			}
			if(c/n){
				prod*=pow(i,c/n);
			}
		}
	}
	if(n==1)
		prod=p;
	cout<<prod<<"\n";

}


Measured memory_bytes: 4224
import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static PrintWriter out;
    public static FastScanner in;

    private void solve() {
        int[] hash = new int[11];
        Arrays.fill(hash,0);

        for(int i=0;i<3;i++){
            hash[in.nextInt()]++;
        }

        if(hash[5] == 2 && hash[7] == 1){
            out.print("YES");
            return;
        }
        out.print("NO");
    }

    private void runIO() {
        in = new FastScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
    }

    private static class FastScanner {
        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        private FastScanner() {
            bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        }

        private String next() {
            if (stringTokenizer == null || !stringTokenizer.hasMoreElements()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

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

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

        private String nextLine() {
            String ret = "";
            try {
                ret = bufferedReader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return ret;
        }
    }

    public static void main(String[] args) {
        new Main().runIO();
    }
}


Measured memory_bytes: 22740
import numpy as np
 
def main():
 
    A = np.zeros([3,3])
    for i in range(3):
        A[i] = list(map(int, input().split()))
 
    B = np.zeros([3,3])
 
    N = int(input())
    for i in range(N):
        b = int(input())
        B[A == b] = 1
 
 
    for i in range(3):
        if B[i,:].sum() == 3:
            print('Yes')
            return
        if B[:, i].sum() == 3:
            print('Yes')
            return
    
    if B[0,0] == B[1,1] == B[2,2] == 1:
        print('Yes')
        return
 
    if B[2,0] == B[1,1] == B[0,2] == 1:
        print('Yes')
        return
 
    print('No')
    return
 
main()

Measured memory_bytes: 12512
import java.util.Scanner;

public class Main {
    public static final double FIRST_DEBT = 100000.0;
    public static final double INTEREST = 0.05;
    public static final double CEIL_BASE = 1000.0;

    public static void main(String args[]) {
        System.out.println(
            calcDebt(FIRST_DEBT, new Scanner(System.in).nextInt())
        );

    }

    private static int calcDebt(double firstDebt, int nWeeks) {
        double debt = firstDebt;
        for(int i = 0; i< nWeeks; i++) {
            debt = Math.ceil(debt * (1 + INTEREST) / CEIL_BASE) * CEIL_BASE;
        }
        return (int)debt;
    }
} 

Measured memory_bytes: 17168
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n,k;
cin>>n>>k;
long long a[n+1]={};
long long b[n+1]={};
long long r;
long long ca=0;
long long cb=0;
for(long long i=0; i<n;i++){
cin>>r;
if(r>0){
a[ca]=r;
ca++;}
else if(r<0){
b[cb]=-1*r;
cb++;
}
else
k--;}
sort(a,ca+a);
sort(b,b+cb);
long long counter=1000000000;
if(k==0){
cout<<0<<endl;}
else if(cb==0){
cout<<a[k-1]<<endl;}
else if(ca==0){
cout<<b[k-1]<<endl;}
else{
for(long long i=0; i<cb;i++){
if(k-i-2<ca){
counter=min(counter,2*b[i]+a[k-i-2]);}}
for(long long i=0; i<ca;i++){
if(k-i-2<cb){
counter=min(counter,2*a[i]+b[k-i-2]);}}
cout<<counter<<endl;}}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using llint = long long int;
using namespace std;

int main() {
    fastIO;
    int n;
    cin >> n;
    vector<int> pi(n);
    rep(i, n) cin >> pi.at(i);

    int cnt = 0;
    rep(i, n - 2) {
        if ((pi.at(i) < pi.at(i + 1) && pi.at(i + 1) < pi.at(i + 2)) ||
            (pi.at(i) > pi.at(i + 1) && pi.at(i + 1) > pi.at(i + 2))) {
            cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3652
N = int(input())
S = input()

alpha2num = lambda c: ord(c) - ord('A') + 1
num2alpha = lambda c: chr(c+64)
list = []
for i in S:
    number = alpha2num(i)
    number_after = number + N
    if number_after > 26:
        number_after = number_after - 26
    i = num2alpha(number_after)
    list.append(i)

print(''.join(list))


Measured memory_bytes: 3188
#include <bits/stdc++.h> 
using namespace std;
#define int long long int
#define float double
#define pb push_back
#define FF first
#define SS second
#define N 100005
#define MOD 1000000007
#define fn(i,n) for(int i=0;i<n;i++)
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define pii pair<int,int>
#define mp make_pair
#define INF 1000000000000000000
#define speed ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

signed main() 
{
    speed;
    //freopen("input.tXt","r",stdin);
    //freopen("output.tXt","w",stdout);
    
    int x;
    cin>>x;
    for(int i=-500;i<=500;i++)
    {
        for(int j=-500;j<=500;j++)
        {
            if(pow(i,5)-pow(j,5)==x)
            {
                cout<<i<<" "<<j;
                return 0;
            }
        }
    }
}   

Measured memory_bytes: 4080
//#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
//using namespace atcoder;
#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; }
    const int MAX =3001;
const int MOD =998244353;

  
  
signed main(){
  int n,ans=0;
  cin>>n;
  for(int i=1;i<n;i++)ans+=(n-1)/i;
  cout<<ans<<endl;
  


}

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


int main()
{
	string s;
	cin>>s;
	deque<char> deq;
	for(char c : s)
	{
		deq.push_back(c);
	}
	int Q;
	cin>>Q;
	int reverse=0;
	rep(cnt,Q)
	{
		int t;
		cin>>t;
		if(t==1)
		{
			reverse++;
			reverse%=2;
		}
		else
		{
			int f;
			cin>>f;
			char c;
			cin>>c;
			f+=reverse;
			f%=2;
			if(f==1)
			{
				deq.push_front(c);
			}
			else
			{
				deq.push_back(c);
			}
		}
	}
	string ans="";
	while(!deq.empty())
	{
		if(reverse==0)
		{
			ans+=deq.front();
			deq.pop_front();
		}
		else
		{
			ans+=deq.back();
			deq.pop_back();
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 4280
#include<bits/stdc++.h>
using namespace std;
int x,y,z,k,t;
long long X[1005],Y[1005],Z[1005],xz[1000005],ans[3000005];
bool cmp(long int x,long int y){
	return x > y;
}
int main(){
	cin >> x >> y >> z >> k;
	for(int i = 1;i <= x;i++)
		cin >> X[i];
	for(int i = 1;i <= y;i++)
		cin >> Y[i];
	for(int i = 1;i <= z;i++)
		cin >> Z[i];
	t = 0;
	for(int i = 1;i <= x;i++)
		for(int j = 1;j <= y;j++){
			t++;
			xz[t] = X[i] + Y[j];
		}
	sort(xz + 1,xz + 1 + t,cmp);
	sort(Z + 1,Z + 1 + z,cmp);
	t = 0;
	for(int i = 1;i <= k;i++)
		for(int j = 1;j <= z;j++){
			t++;
			ans[t] = xz[i] + Z[j];
		}
	sort(ans + 1,ans + 1 + t,cmp);
	for(int i = 1;i <= k;i++)
		cout << ans[i] << endl;
	return 0;	
	
}

Measured memory_bytes: 31488