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

typedef long long LL;

typedef struct ParserState {
    int pos, len;
    std::string str;
    std::deque<int> stack;

    bool isEOF() {return pos >= len;}
    bool isNotEOF() {return pos < len;}

    char getCh() {
        return pos < len ? str[pos++] : -1;
    }
    char seek() {
        return pos < len ? str[pos] : -1;
    }
    char seek(int offset) {
        return (pos+offset) < len ? str[pos+offset] : -1;
    }
    std::string lookAhead(int l) {
        return str.substr(pos, l);
    }

    void setBackrack(){stack.push_front(pos);}
    bool backtrack(){
        if(stack.empty()) return false;
        pos = stack.front();
        stack.pop_front();
        return true;
    }

    bool isDigit(){return isDigit(0);}
    bool isDigit(int offset) {
        char c = seek(offset);
        return c != -1 && c >= '0' && c <= '9';
    }
    bool isUpperAlpha(){return isUpperAlpha(0);}
    bool isUpperAlpha(int offset) {
        char c = seek(offset);
        return c != -1 && c >= 'A' && c <= 'Z';
    }
    bool isLowerAlpha(){return isLowerAlpha(0);}
    bool isLowerAlpha(int offset) {
        char c = seek(offset);
        return c != -1 && c >= 'a' && c <= 'z';
    }
}State;

std::map<char,int> pri;

LL parseNumber(State*);
LL parse(State*);

LL calc(char op, LL left, LL right) {
    if(op == '+') return left + right;
    if(op == '-') return left - right;
    if(op == '*') return left * right;
    return assert(pri.count(op) > 0), -1;
}


int bot = 0;
LL parseNumber(State* state) {
    LL res = 0LL;
    while(state->isNotEOF() && state->isDigit()) {
        res *= 10;
        res += (int)(state->getCh() - '0');
    }
    return res;
}

LL parse(int level, State* state) {
    if(bot < level) {
        if(state->isDigit()) return parseNumber(state);

        state->getCh(); // eat (
        LL r = parse(0, state);
        state->getCh(); // eat )
        return r;
    }

    LL result = parse(level + 1, state);
    while(state->isNotEOF() && state->seek() != ')') {
        char ch = state->seek();
        if(pri[ch] < level) break;
        state->getCh(); //eat op

        LL res = parse(level + 1, state);
        result = calc(ch, result, res);

        if(state->isEOF()) break;
    }
    return result;
}

int main() {
    std::string S;
    std::cin >> S;
    int len = S.length();

    LL ans = std::numeric_limits<LL>::min();
    for(int i=0; i<27; ++i) {
        pri['+'] = i     % 3;
        pri['-'] = (i/3) % 3;
        pri['*'] = (i/9) % 3;
        bot = std::max(i%3, std::max((i/3)%3, (i/9)%3));

        State state = State{0, len, S};
        LL res = parse(0, &state);

        ans = std::max(ans, res);
    }
    std::cout << ans << std::endl;
    return 0;
}

Measured memory_bytes: 3236
#include <iostream>
using namespace std;
#define MAX 100000

void swap(int *x, int *y) {
  int tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}

int pertition(int *A, int p, int r) {
  int x = A[r];
  int i = p-1;
  for (int j = p; j < r; j++) {
    if (A[j] <= x) {
      i++;
      swap(A[i], A[j]);
    }
  }
  swap(A[i+1], A[r]);
  return i+1;
}

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

  int A[MAX];
  for (int i = 0; i < n; i++) cin >> A[i];

  int x = pertition(A, 0, n-1);
  for (int i = 0; i < x; i++) 
    cout << A[i] << " " << flush;
  cout << "[" << A[x] << "]" << flush;
  for (int i = x+1; i < n; i++) 
    cout << " " << A[i] << flush;
  cout << endl;

  return 0;
}


Measured memory_bytes: 3444
#include<bits/stdc++.h>
using namespace std;
int main()
{int a,b;
 cin>>a>>b;
 if(a>0||(a<0&&b<0&&(b-a+1)%2==0))
   {cout<<"Positive"<<endl;
    return 0;
   }
 if((a<=0&&b>=0)||a>=0)
   {cout<<"Zero"<<endl;
    return 0;
   }
 cout<<"Negative"<<endl;
}

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

using namespace std;

int main(){
    int max_heignt[3] = {0};
    for(int i=0; i<10; i++){
        int height;
        int min_temp;
        int max_tmp;
        cin >> height;

        max_heignt[0] = max(height, max_heignt[0]);
        max_tmp = max(max_heignt[0], max_heignt[1]);
        for(int j=0;j<2;j++){
            max_tmp = max(max_heignt[j], max_heignt[j+1]);
            min_temp = min(max_heignt[j], max_heignt[j+1]);
            max_heignt[j] = min_temp;
            max_heignt[j+1] = max_tmp;
        }
    }

    for (int i = 3; i > 0; i--){
        cout << max_heignt[i-1] << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3112
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,j,k;
  cin>>n>>k;
  int h[n];
  for(i = 0 ; i < n ; i++)
    cin>>h[i];
    int dp[n] = {0};
    if(n>1)
    dp[1] = abs(h[1]-h[0]);
    k = min(n,k);
    for(i = 2; i < k ; i++)
{
    dp[i] = (dp[i-1]+(abs(h[i]-h[i-1])));
    for(j = i-2; j>=0 ; j--)
    {dp[i] = min(dp[j]+(abs(h[i]-h[j])),dp[i]);}
}

for(i = k;i<n;i++)
{
    dp[i] = (dp[i-1]+(abs(h[i]-h[i-1])));
    for(j = i-2; j>=i-k; j--)
    {dp[i] = min(dp[j]+(abs(h[i]-h[j])),dp[i]);}
}

cout<<dp[n-1];
return 0;
}




Measured memory_bytes: 1024
import java.util.Scanner;
public class Main {

    public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
          
switch (s % 10) { 
    case 2:    System.out.println("hon");break;
    case 4:    System.out.println("hon");break;
    case 5:    System.out.println("hon");break;
    case 7:    System.out.println("hon");break;
    case 9:    System.out.println("hon");break;
    

    
  
    case 0: System.out.println("pon");break;
    case 1:System.out.println("pon");break;
    case 6:System.out.println("pon");break;
    case 8:System.out.println("pon");break;

     
    case 3:System.out.println("bon"); 
 
    defalt:
    break;
    
   
   }
	}
}

Measured memory_bytes: 35572
#include <iostream>
#include <string>
#include <map>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    map<string, long long> mp;
    for(int i = 0; i < n; i++){
        string str;
        cin >> str;
        sort(begin(str), end(str));
        mp[str]++;
    }
    long long ans = 0;
    for(auto&& i : mp){
        ans += i.second * (i.second - 1) / 2;
    }
    cout << ans << "\n";
}

Measured memory_bytes: 13184
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define PB push_back
#define MP make_pair
#define ARSCD(A,N) REP(i,N){SCD(A[i]);}
#define ARSCD1(A,N) FORq(i,1,N){SCD(A[i]);}
#define PRINTD(n) printf("%d\n",n)
#define PRINTLLD(n) printf("%lld\n",n)
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define IN(x,S) (S.count(x) != 0)
using namespace std;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector < VI > VVI;
typedef long long ll;
/////////////////////////(๑•﹏•๑｀)/////////////////////////
int n,q;
int a[100000];

int binary_search(int key){
	// <= left never satisfy
	// right <= always satisfy

	int left = -1; 
	int right = n; // index of size + 1;

	while(right - left > 1){
			int mid = left + (right - left) / 2;

			if (a[mid] >= key) right = mid;
			else left = mid;
	}

	// left is the maximum that don't satisfy the condition.
	// right is the minimum that satisfies the condtion.

	return right; 

}

int main(){
	SCD(n);
	REP(i,n){
		int x; SCD(x);
		a[i] = x;
	}

	SCD(q);

	REP(i,q){
		int k; SCD(k);
		if (a[binary_search(k)] == k) PRINTD(1);
		else PRINTD(0);
	}

	return 0;
}
	
	



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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

typedef long long LL;
const LL mod=1000000007;
#define MAX 10000
#define NIL -1
const double PI  = acos(-1.0);
const int INF = 1e9 + 7;
//-------------------------------------------


char c[51][51];

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int h , w;
    bool flag = true;

    cin >> h >> w;

    for(int i=0 ; i < h ; i++ ){
        for(int j=0 ; j < w ; j++ ){
            cin >> c[i][j];
        }
    }
    REP(i, h){
        REP(j, w){

            if( c[i][j] == '#'){

                if( i > 0 && i < h - 1 && j > 0&& j < w -1 ){


                    if (c[i][j + 1] == '.' && c[i][j - 1] == '.' && c[i - 1][j] == '.' &&c[i + 1][j] == '.'){
                        flag = false;
                        break;
                    }
                }
                else if( i > 0 && i < h -1 && j == 0){

                    if( c[i][j + 1] == '.' && c[i - 1][j] == '.' &&c[i + 1][j] == '.'){
                        flag = false;
                        break;
                    }

                }else if( i > 0 && i < h -1 && j == w -1){

                    if(c[i][j - 1] == '.' && c[i - 1][j] == '.' &&c[i + 1][j] == '.'){
                        flag = false;
                        break;
                    }
                }

                else if( i == 0 && j > 0&& j < w -1){

                    if( c[i][j + 1] == '.' && c[i][j - 1] == '.' &&c[i + 1][j] == '.'){
                        flag = false;
                        break;
                    }
                }
                else if( i == h -1 && j > 0&& j < w -1){

                    if( c[i][j + 1] == '.' && c[i][j - 1] == '.' &&c[i - 1][j] == '.'){
                        flag = false;
                        break;
                    }
                }
            }
        }
    }

    if (flag == 0){ cout << "No" << endl;}
    else { cout << "Yes" << endl;}

    return 0;
}


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

using namespace std;
template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

using ll = long long int;

int main(void) {
  ll n, m;
  cin >> n >> m;
  vector<pair<ll, ll>> v;
  for (int i = 0; i < n; i++) {
    ll x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  ll sum = 0;
  sort(v.begin(), v.end());
  auto it = v.begin();
  while (m > 0) {
    if(it->second<m) {
      m-=it->second;
      sum+=it->first*(it->second);
    } else {
      sum+=m*(it->first);
      break;
    }
    it++;
  }
  std::cout << sum << std::endl;
  return 0;
}


Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
const int Q=55;
int n,m,q,ans;
int a[Q],b[Q],c[Q],d[Q];
int x[11];
bool getnxt(){
	int tl=n;
	while(x[tl]==m) --tl;
	if(!tl) return false;
	++x[tl++];
	while(tl<=n){
		x[tl]=x[tl-1];
		++tl;
	}
	return true;
}
template<class T>inline void chk(T &a,T b){if(b>a) a=b;}
int main()
{
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	scanf("%d %d %d",&n,&m,&q);
	for(int i=1;i<=q;++i) scanf("%d %d %d %d",&a[i],&b[i],&c[i],&d[i]);
	for(int i=1;i<=n;++i) x[i]=1;
	do{
//		for(int i=1;i<=n;++i) printf("%d ",x[i]);
//		printf("\n");
		int tmp=0;
		for(int i=1;i<=q;++i){
			if(x[b[i]]-x[a[i]]==c[i]) tmp+=d[i];
		}
		chk(ans,tmp);
	}while(getnxt());
	printf("%d\n",ans);
}

Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
using pi = pair<int, int>;

int h, w;
queue< pi > qpi;
vector<char> Graph[1000];

int bfs() {
  int cnt = 0;
  bool flg;
  vector< pi > side = { pi(1,0), pi(-1, 0), pi(0, 1), pi(0, -1) };
  while (!qpi.empty()) {
    flg = false;
    int size = qpi.size();
    for (int i = 0; i < size; i++) {
      pi current = qpi.front();
      qpi.pop();

      for (auto z : side) {
        int x, y;
        x = current.second + z.second; y = current.first + z.first;
        if (0 <= x && x < w && 0 <= y && y < h && Graph[y][x] == '.') {
          flg = true;
          Graph[y][x] = '#';
          qpi.push(make_pair(y, x));
        }
      }
    }
    if (flg) ++cnt;
  }
  return cnt;
}

int main() {
  scanf("%d %d", &h, &w);

  pi start;
  for (int i = 0; i < h; i++) {
    string s;
    cin >> s;

    for (int j = 0; j < w; j++) {
      if (s[j] == '#') {
        qpi.push(make_pair(i, j));
      }
      Graph[i].push_back(s[j]);
    }
  }
  cout << bfs() << endl;

  return 0;
}


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

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define ANS(ans) cout<<(ans)<<endl;


//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main() {
	
	int n, d, x;
	cin >> n >> d >> x;
	int ans = 0;

	REP(i, n) {
		int a;
		cin >> a;
		FOR(j,1, d+1) {
			REP(k, d) {
				if (j == a*k + 1) {
					ans++;
				}
			}
		}
	}

	ANS(ans + x);

	return 0;
}



Measured memory_bytes: 256
#include<iostream> 
#define fastio(); ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"

using namespace std; 
  
int main() 
{
	fastio();
	int T,n,flag=1;;
	cin >> T;
	while(T--){
		cin >> n;
		if(!(n%2)){
			if(n%3 && n%5)
				flag=0;
		}
	}
	if(flag)
		cout << "APPROVED";
	else cout << "DENIED";
    return 0; 
}

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

int main() {
  int D;
  cin>>D;
  if(D==25){
    cout<<"Christmas"<<endl;
  }
  else if(D==24){
    cout<<"Christmas Eve"<<endl;
  }
  else if(D==23){
    cout<<"Christmas Eve Eve"<<endl;
  }
  else{
    cout<<"Christmas Eve Eve Eve"<<endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
ll n,a[200001];
map<ll,ll> mp;
int main(){
	ios::sync_with_stdio(0);
	cin>>n;
	ll sum=0;
	mp[sum]++;
	rep(i,n){
		cin>>a[i];
		sum+=a[i];
		mp[sum]++;
	}
	ll ans=0;
	foreach(it,mp){
		ll cnt=it->second;
		ans+=cnt*(cnt-1)/2;
	}
	cout<<ans;
	re 0;
}

Measured memory_bytes: 14336
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<cmath>
#include<vector>
#include<queue>
using namespace std;
const int N=2e5+5;
int n,m,len;
char s[N],t[N];
int main(){
    scanf("%d%d%d",&n,&m,&len);
    int y,x;scanf("%d%d",&y,&x);
    scanf("%s%s",s+1,t+1);
    bool ok=0;
    int yy=y;
    for(int i=1;i<=len;i++){
        if(s[i]=='U') yy--;
        if(yy==0) ok=1;
        if(yy<n&&t[i]=='D') yy++;
    }
    yy=y;
    for(int i=1;i<=len;i++){
        if(s[i]=='D') yy++;
        if(yy>n) ok=1;
        if(yy>1&&t[i]=='U') yy--;
    }
    int xx=x;
    for(int i=1;i<=len;i++){
        if(s[i]=='L') xx--;
        if(!xx) ok=1;
        if(xx<m&&t[i]=='R') xx++;
    }
    xx=x;
    for(int i=1;i<=len;i++){
        if(s[i]=='R') xx++;
        if(xx>m) ok=1;
        if(xx>1&&t[i]=='L') xx--;
    }
    if(ok) puts("NO");
    else puts("YES");
}


Measured memory_bytes: 640
def read_input():
  n = int(input())
  a = [int(item) for item in input().split()]
  return n,a

def main():
  n,a = read_input()
  l = [0 for i in range(8)]
  experts = 0
  for score in a:
    if score > 3199:
      experts += 1
    else:
      l[score//400] += 1
  minimum = 8-l.count(0)
  maximum = minimum + experts
  if minimum == 0:
    minimum = 1
  print(minimum, maximum)

if __name__ == '__main__':
  main()

Measured memory_bytes: 3060
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[ list(map(int,input().split())) for _ in range(n)]
#print(a)
ans=0
for i in range(n):
    s=0
    for j in range(m):
        s+=a[i][j]*b[j]
    if s+c>0:
        ans+=1
print(ans)


Measured memory_bytes: 3316
#include <stdio.h>
int main(){
	int H,W;
	scanf("%d%d", &H,&W);
	char s[H+1][W+1];
	for(int i=1;i<=H;i++)
		scanf("%s", s[i]);
	for(int i=1;i<=H;i++){
		printf("%s\n%s\n", s[i],s[i]);
	}
	return 0;
}

Measured memory_bytes: 128
# -*- coding: utf-8 -*-
n = int(input())
ta = [list(map(int,input().split())) for i in range(n)]

cur_t = 1
cur_a = 1


def ceil(a, b):
    return a // b + int(a % b != 0)

for t,a in ta:
    if cur_t > t or cur_a > a:
        rate = max([ceil(cur_t,t),ceil(cur_a,a)])
        cur_t = t*rate
        cur_a = a*rate
    else:
        cur_t=t
        cur_a=a
print(cur_t+cur_a)


Measured memory_bytes: 3188
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <map>
#include<set>
#include <cmath>
#include <stack>
using namespace std;



int main() {
	string s;
	cin >> s;
	if (s.at(1) == 'R')cout << "ABC" << endl;
	else cout << "ARC" << endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin>>N;
    vector<int> p(N);
    for(int i=0;i<N;i++) cin>>p[i],p[i]--;
    int ans=0;
    for(int i=0;i+1<N;i++) {
        if(p[i]==i) {
            ans++;
            swap(p[i],p[i+1]);
        }
    }
    if(p[N-1]==N-1) ans++;
    cout<<ans<<endl;
}

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

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)

bool CheckStr(const string& s, const string& p) {
	string str(s);
	REP(i, str.size()) {
		if (str.find(p) != string::npos) return true;
		str = str.substr(1, str.size() - 1) + str.substr(0, 1);
	}
	return false;
}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);

	string s, p;
	cin >> s >> p;
	cout << (CheckStr(s, p) ? "Yes" : "No") << endl;
	return 0;
}



Measured memory_bytes: 3208
import sys
inf = float('inf')

def solve():
    N, M = map(int, input().split())
    edges = [None] * M

    for i in range(M):
        a, b, c = map(int, sys.stdin.readline().split())
        a, b = a-1, b-1
        edges[i] = (a, b, -c)

    ans = BellmanFord(N, M, edges)
    if ans is None:
        print('inf')
    else:
        print(-ans)

def BellmanFord(N, M, edges):
    d = [inf] * N
    d[0] = 0

    for i in range(N-1):
        for (u, v, c) in edges:
            if d[u] + c < d[v]:
                d[v] = d[u] + c

    for (u, v, c) in edges:
        if d[u] + c < d[v]:
            d[v] = -inf

    for i in range(N-1):
        for (u, v, c) in edges:
            if d[u] + c < d[v]:
                d[v] = -inf
            if v == N-1 and d[v] == -inf:
                return None
    return d[N-1]

if __name__ == '__main__':
    solve()

        


Measured memory_bytes: 41836
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Main{

	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in );
		
		int []pow=new int [6];
		pow[0]=1;
		for(int i=1;i<=5;i++)
			pow[i]=2*pow[i-1];
		int n=sc.nextInt();int m=sc.nextInt();
		int ans=(n-m)*100+1900*m;
		System.out.println(pow[m]*ans);
		
		
		
		
		
	}

}
class Scanner 
{
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

	public String next() throws IOException 
	{
		while (st == null || !st.hasMoreTokens()) 
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {return Integer.parseInt(next());}
	
	public long nextLong() throws IOException {return Long.parseLong(next());}

	public String nextLine() throws IOException {return br.readLine();}
	
	public double nextDouble() throws IOException
	{
		String x = next();
		StringBuilder sb = new StringBuilder("0");
		double res = 0, f = 1;
		boolean dec = false, neg = false;
		int start = 0;
		if(x.charAt(0) == '-')
		{
			neg = true;
			start++;
		}
		for(int i = start; i < x.length(); i++)
			if(x.charAt(i) == '.')
			{
				res = Long.parseLong(sb.toString());
				sb = new StringBuilder("0");
				dec = true;
			}
			else
			{
				sb.append(x.charAt(i));
				if(dec)
					f *= 10;
			}
		res += Long.parseLong(sb.toString()) / f;
		return res * (neg?-1:1);
	}
	
	public boolean ready() throws IOException {return br.ready();}


}

Measured memory_bytes: 21076
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a = gi();
    int b = gi();
    if (a%2 != b%2)
        printf("IMPOSSIBLE\n");
    else
        printf("%d\n", (a+b)/2);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
using LP=pair<ll,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007,MOD2=998244353;



int main() {
    string s;
    cin>>s;
    int ans=0;
    char a=s.at(0),b=s.at(1),c=s.at(2);
    if(a=='R'){
        if(b=='R'){
            if(c=='R')ans=3;
            else ans=2;
        }
        else{
            ans=1;
        }
    }
    else{
        if(b=='R'){
            if(c=='R')ans=2;
            else ans=1;
        }
        else if(c=='R')ans=1;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3620
import java.util.*;
import java.awt.Point;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		while(true){
			int n = sc.nextInt();
			int m = sc.nextInt();
			if(n == 0 && m == 0) break;

			ArrayList<ArrayList<Point>> map = new ArrayList<ArrayList<Point>>();
			for(int i=0;i<n;i++){
				ArrayList<Point> tmp = new ArrayList<Point>();
				int k = sc.nextInt();
				for(int j=0;j<k;j++){
					tmp.add(new Point(sc.nextInt()-1,sc.nextInt()));
				}
				map.add(tmp);
			}

			PriorityQueue<State> open = new PriorityQueue<State>();
			HashSet<State> closed = new HashSet<State>();
			for(int i=0;i<2;i++){
				if(m < i) continue;
				for(Point p : map.get(i)){
					State nst = new State(p.x,i,p.y,m-i,0);
					open.add(nst);
				}
			}

			State ans = null;

			while(!open.isEmpty()){
				State st = open.poll();
				if(closed.contains(st)) continue;
				closed.add(st);

				if(st.y == n){
					ans = st;
					break;
				}

				open.addAll(st.nexts(map));
			}

			System.out.println(ans.cost);
		}
	}
}

class State implements Comparable<State>{
	int x,y,d,rem,cost;

	State(int x,int y,int d,int rem,int cost){
		this.x = x;
		this.y = y;
		this.d = d;
		this.rem = rem;
		this.cost = cost;
	}

	public List<State> nexts(ArrayList<ArrayList<Point>> map){
		List<State> sts = new ArrayList<State>();

		for(int i=1;i<=2;i++){
			//ツ古シツつアツつ、ツ甘敖づ可づつつ「ツつス
			if(y + i >= map.size()){
				//1ツ行ツづづ篠つオツづつォツづ按つ「ツ湘ェツ債暗按外ツづづ猟づゥ
				if(i == 1 || i == 2 && rem > 0){
					sts.add(new State(0,map.size(),0,0,cost));
				}
				continue;
			}

			//1ツ行ツづづ篠つオツづつォツづ按つ「ツつゥツづァツ終ツ猟ケ
			if(i == 2 && rem == 0) break;

			for(Point p : map.get(y+i)){
				sts.add(new State(p.x,y+i,p.y,rem-(i-1),cost+(d+p.y)*Math.abs(x-p.x)));
			}
		}

		return sts;
	}

	public int compareTo(State st){
		return this.cost - st.cost;
	}

	public boolean equals(Object o){
		State st = (State)o;
		return x == st.x && y == st.y && rem == st.rem;
	}

	public int hashCode(){
		return rem * 1000000 + x * 1000 + y;
	}

	public String toString(){
		return String.format("[(%d,%d),c:%d,r:%d]",x,y,cost,rem);
	}
}

Measured memory_bytes: 39000
import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val s = (1..n).map { sc.next() }

  val map = mutableMapOf<String, Int>()
  for (si in s) {
    val tmp = map.getOrElse(si) { 0 }
    map.put(si, tmp + 1)
  }

  println("AC x " + map.getOrElse("AC") { 0 })
  println("WA x " + map.getOrElse("WA") { 0 })
  println("TLE x " + map.getOrElse("TLE") { 0 })
  println("RE x " + map.getOrElse("RE") { 0 })

}


Measured memory_bytes: 64524
// =========
use std::cmp::max;
const MOD: usize = 1000000007;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    // var... 変数の識別子, $t...型を一つよむ
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        //ここで繰り返し
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    //
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    // 配列の最後のNestではここで型が指定されてparseされる
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
// =========

fn main() {
    input! {
        n: usize,
    }

    let mut ans = 1;
    for i in 1..n + 1 {
        ans *= i;
        ans %= MOD;
    }
    println!("{:?}", ans);
}


Measured memory_bytes: 4352
# coding:utf-8

import sys
from collections import Counter


input = sys.stdin.readline
INF = float('inf')
MOD = 10 ** 9 + 7


def inpl(): return list(map(int, input().split()))


def solve():
    N = int(input())
    A = inpl()

    max_a = max(A)
    min_a = min(A)
    num_cnt = Counter(A)

    if max_a - min_a > 1:
        return 'No'

    if len(num_cnt) == 1:
        if max_a == N - 1 or 2 * max_a <= N:
            return 'Yes'
        else:
            return 'No'

    not_alone = num_cnt[max_a]
    alone = num_cnt[min_a]
    if not_alone >= (max_a - alone) * 2 and alone < max_a:
        return 'Yes'

    return 'No'


print(solve())


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

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

  int n, m, x, y;
  cin >> n >> m >> x >> y;
  vector<int> a(n + 1);
  vector<int> b(m + 1);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  a[n] = x; b[m] = y;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  string ans = (a[n] < b[0]) ? "No War" : "War";
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 256
import bisect,collections,copy,itertools,math,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
S = S()
N = len(S)
S1 = S == S[::-1]
S2 = S[:(N-1)//2] == S[:(N-1)//2][::-1]
S3 = S[(N+3)//2-1:] == S[(N+3)//2-1:][::-1]
print('Yes' if S1 and S2 and S3 else 'No')

Measured memory_bytes: 3900
# coding: utf-8
# Your code here!
#動的計画法

N = int(input())
Ni_2 = 2
Ni_1 = 1
Ni = 1
Ni_dummy = 0

for i in range(2, N + 1):
    Ni = Ni_1 + Ni_2
    Ni_2 = Ni_1
    Ni_1 = Ni
print(Ni)


Measured memory_bytes: 2940
S = input()
k = "keyence"
n = 0
ans = False
for i in range(8):
    if i==0:
        if S[-7:] == k:
            ans = True
    elif i==7:
        if S[:7]==k:
            ans = True
    else:
        if S[:i]==k[:i] and S[-(7-i):]==k[-(7-i):]:
            ans = True
if ans:
    print("YES")
else:
    print("NO")


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


int main(){
    int n, k;
    cin >> n >> k;
    set<int> se;

    rep(i,k){
        int x;
        cin >> x;
        se.insert(x);
    }
    bool f = 0;
    for (int i = n;; i++) {
		for (int s = i; s > 0; s /= 10) {
			if (se.count(s % 10)) {
				f = 1;
				break;
			}
		}
		if(!f) {
			cout << i << endl;
			return 0;
		}
		f = 0;
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[202020],n;
long long s[202020];
long long cal(int x,int y,int z)
{
	if(x<=0 || x>=y || y>=z || z>=n)
	{
		return 1e18+10;
	}
	vector<long long>v;
	v.push_back(s[x]-s[0]);
	v.push_back(s[y]-s[x]);
	v.push_back(s[z]-s[y]);
	v.push_back(s[n]-s[z]);
	sort(v.begin(),v.end());
	return v[3]-v[0];
}
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		s[i+1]=s[i]+a[i];
	}
	long long ans=1e18+10;
	for(int i=2;i<n-1;i++)
	{
		int x=upper_bound(s,s+n+1,s[i]/2)-s,y=upper_bound(s,s+n+1,s[i]+(s[n]-s[i])/2)-s;
		for(int j=0;j<2;j++)
		{
			for(int k=0;k<2;k++)
			{
				ans=min(ans,cal(x-j,i,y-k));
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 2560
/*    特徴    */

/*    教訓    */

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ld  = long double;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
const int INF=1e9+7;
const ll LINF=9223372036854775807;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld EPS = 1e-9; //微調整用（EPSより小さいと0と判定など）

int ii() { int x; if (scanf("%d", &x)==1) return x; else return 0; }
long long il() { long long x; if (scanf("%lld", &x)==1) return x; else return 0; }
string is() { string x; cin >> x; return x; }
char ic() { char x; cin >> x; return x; }
void oi(int x) { printf("%d ", x); }
void ol(long long x) { printf("%lld ", x); }
void od_nosp(double x) { printf("%.15f", x); } // 古い問題用
void od(double x) { printf("%.15f ", x); }
// long doubleで受け取り、fをLfなどに変えて出力すると、変な数値が出る
// それをなんとかするには独自の出力を作らなければならなそう
void os(const string &s) { printf("%s ", s.c_str()); }
void oc(const char &c) { printf("%c ", c); }
#define o_map(v){cerr << #v << endl; for(const auto& xxx: v){cout << xxx.first << " " << xxx.second << "\n";}} //動作未確認
void br() { putchar('\n'); }

#define gcd __gcd //llは受け取らない C++17~のgcdと違うので注意
int lcm(int a, int b){return a / gcd(a, b) * b;}
#define begin_end(a) a.begin(),a.end() //sort(begin_end(vec));
#define REP(i,m,n) for(ll i=(ll)(m) ; i < (ll) (n) ; i++ )
#define rep(i,n) REP(i,0,n)
#define m_p(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define p_b push_back
#define SZ(x) ((int)(x).size) //size()がunsignedなのでエラー避けに

//4近傍（上下左右） rep(i, 2) にすると右・下だけに進む
vector<int> dx_4 = {1, 0, -1, 0};
vector<int> dy_4 = {0, 1, 0, -1};

// coutによるpairの出力（空白区切り）
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << " " << p.second << ")";}
// coutによるvectorの出力（空白区切り）
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << " "; //"\t"に変えるとTabで見やすく区切る
  }
  return s;
}
// coutによる多次元vectorの出力（空白区切り）
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i] << endl;
  }
  return s;
}

//最大値、最小値の更新。更新したor等しければtrueを返す
template<typename T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<typename T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}

// -------- template end - //


// - library ------------- //



// --------- library end - //




int main(){

  ll a = il();
  ld B = stold(is());


  ll b = round(B * 100);


  cout << ( a * b ) / 100 << endl;



}

Measured memory_bytes: 3860
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P; typedef priority_queue<int> Pr; typedef vector<int> V; typedef vector<P> Vp; typedef map<int,int> MP;
const int mod = 1000000007; const Int INF = 1145141919810893931;
#define END {cout<<ans<<'\n'; return 0;}
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template< typename T >
struct edge {
  int src, to;
  T cost;

  edge(int to, T cost) : src(-1), to(to), cost(cost) {}

  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}

  edge &operator=(const int &x) {
    to = x;
    return *this;
  }

  operator int() const { return to; }
};

template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WeightedGraph = vector< Edges< T > >;
using UnWeightedGraph = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;

template< typename T >
vector< T > dijkstra(WeightedGraph< T > &g, int s) {
  const auto INF = numeric_limits< T >::max()/2;
  vector< T > dist(g.size(), INF);

  using Pi = pair< T, int >;
  priority_queue< Pi, vector< Pi >, greater< Pi > > que;
  dist[s] = 0;
  que.emplace(dist[s], s);
  while(!que.empty()) {
    T cost;
    int idx;
    tie(cost, idx) = que.top();
    que.pop();
    if(dist[idx] < cost) continue;
    for(auto &e : g[idx]) {
      auto next_cost = cost + e.cost;
      if(dist[e.to] <= next_cost) continue;
      dist[e.to] = next_cost;
      que.emplace(dist[e.to], e.to);
    }
  }
  return dist;
}


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

    int n,q,k; cin>>n; WeightedGraph<Int> g(n);
    for (int i = 0; i < n-1; i++){
        int a,b,c; cin>>a>>b>>c;
        g[a-1].emplace_back(b-1,c);
        g[b-1].emplace_back(a-1,c);
    }
    cin>>q>>k; vector<Int>d=dijkstra(g,k-1);
    for (int i = 0; i < q; i++){
        int x,y; cin>>x>>y;
        cout<<d[x-1]+d[y-1]<<'\n';
    }
}

Measured memory_bytes: 11120
#include <iostream>
    #include <stdio.h>
    #include <cstring>
    #include <algorithm>
    using namespace std;
    int main()
    {
        int N;
        string a;
        long int b[5]={0};
        cin>>N;
        while(N--)
        {
            cin>>a;
            if(a[0]=='M')
                b[0]++;
            else if(a[0]=='A')
                b[1]++;
            else if(a[0]=='R')
                b[2]++;
            else if(a[0]=='C')
                b[3]++;
            else if(a[0]=='H')
                b[4]++;
        }
        int flag=0;
        long s;
        for(int i=0; i<5; i++)
            if(b[i])
                flag++;
        if(flag<3)
            printf("0\n");
        else if(flag==3)
        {
            s=1;
            for(int i=0; i<5; i++)
                if(b[i])
                    s*=b[i];
            cout<<s<<endl;
        }
        else if(flag>=4)
        {
            s=0;
            int x,y,z;
            for(x=0; x<3; x++)
                for(y=x+1; y<4; y++)
                    for(z=y+1; z<5; z++)
                        if(b[x]&&b[y]&&b[z])
                            s+=b[x]*b[y]*b[z];
            cout<<s<<endl;
        }
        return 0;
    }

Measured memory_bytes: 256
n, c, k = map(int, input().split())
t = sorted([int(input()) for _ in range(n)])
bus = []
count = 0
p = t.pop(0)
bus.append(p)
while t != []:
    p = t.pop(0)
    if bus[0] + k >= p and len(bus) < c:
        bus.append(p)
    else:
        count += 1
        bus = [p]
print(count+1)


Measured memory_bytes: 8276
#include <bits/stdc++.h>    
using namespace std;
 
#define CIN1(a) long long a;cin >> a;
#define CIN2(a,b) long long a,b;cin >> a >> b;
#define CIN3(a,b,c) long long a,b,c;cin >> a >> b >> c;
#define rep(i,n) for(int i=0,i##_len=(n); i<i##_len; ++i)
 
int main(){
    CIN2(x,y) 
    cout << x+y/2 << endl;
}


Measured memory_bytes: 256
import math

K = int(input())

def gcd(a, b, c):
    nums = [a, b, c]
    d = 0
    for n in nums:
        d = math.gcd(d, n)

    return d

result = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            result += gcd(a, b, c)

print(result)

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

#define loop(n, i) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;

using namespace std;
typedef long long ll;


int main()
{
    vector<char> list(52, 0);
    char c = 'a';
    loop(26,i) list[i] = c+i;
    c = 'A';
    for(int i = 26; i<52; i++) list[i] = c+i-26;

    int n;
    while (cin >> n, n) {
        vector<int> k(n, 0);
        loop(n, i) cin >> k[i];
        string s; cin >> s;
        string ans = "";
        int ite = 0;
        for (auto c : s) {
            int i = distance(list.begin(), find(all(list), c));
            ans += i-k[ite] < 0 ?
                list[i-k[ite]+52] : list[i-k[ite]];
            ite = n==++ite? 0 : ite;
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 3204
//↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0 }, dy[] = { 0,1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

long long mod_pow(long long a, long long b) {
	long long res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}

	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

//↑template↑

int a,b,k[100005],n;
int main(){
  cin>>a;
  for(int i=0;i<a;++i){cin>>k[i];}
  cin>>b;
  for(int i=0;i<b;++i){
    cin>>n;
    cout<<(k[lower_bound(k,k+a,n)-k]==n)<<endl;
  }
}


Measured memory_bytes: 3508
#include <bits/stdc++.h>
using namespace std;
#define INF 100005

int main()
{
	//freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
	int l,r,d;
	cin >> l >> r >> d;
	int cc=0;
	for(int i=l;i<=r;i++)
	{
		if(i%d==0) cc++;
	}	
	cout << cc << "\n";
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int n, r;
  cin >> n >> r;
  if (n >= 10) {
    cout << r << endl;
  } else {
    cout << r + (100*(10-n)) << endl;
  }
  return 0;
}

Measured memory_bytes: 3536
#![allow(unused_imports)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_mut)]
use num::integer::gcd;
use proconio::fastout;
use proconio::input;
use proconio::marker::{Bytes, Chars};
use std::f64::consts::PI;
use std::mem::swap;

type Pi = (i32, i32);

fn pri<T: std::fmt::Display>(x: T) {
    println!("{}", x);
}

#[fastout]
fn main() {
    input! {
        n: u32, k:u32,
    }
    let mut ans = Mint(0);
    let mut sum = vec![Mint(0)];
    for i in 0..n + 1 {
        sum.push(Mint(i) * (Mint(i + 1)) * Mint(2).inv());
    }
    let n = n as usize;
    let k = k as usize;
    for i in k..n + 2 {
        ans += sum[n + 1] - sum[n + 1 - i] - sum[i] + Mint(1);
    }
    pri(ans);
}

// Modint
const MOD: u32 = 1_000_000_007;
#[derive(Clone, Copy)]
struct Mint(u32);
impl std::ops::Add for Mint {
    type Output = Mint;
    fn add(self, x: Mint) -> Mint {
        let res = self.0 + x.0;
        Mint(if res >= MOD { res - MOD } else { res })
    }
}
impl std::ops::AddAssign for Mint {
    fn add_assign(&mut self, x: Mint) {
        *self = *self + x;
    }
}
impl std::ops::Sub for Mint {
    type Output = Mint;
    fn sub(self, x: Mint) -> Mint {
        let res = self.0 + MOD - x.0;
        Mint(if res >= MOD { res - MOD } else { res })
    }
}
impl std::ops::SubAssign for Mint {
    fn sub_assign(&mut self, x: Mint) {
        *self = *self - x;
    }
}
impl std::ops::Mul for Mint {
    type Output = Mint;
    fn mul(self, x: Mint) -> Mint {
        Mint((self.0 as u64 * x.0 as u64 % MOD as u64) as u32)
    }
}
impl std::ops::MulAssign for Mint {
    fn mul_assign(&mut self, x: Mint) {
        *self = *self * x;
    }
}
impl std::ops::Div for Mint {
    type Output = Mint;
    fn div(self, x: Mint) -> Mint {
        let mut a = x.0 as i64; //solves au + mv = 1 and u = a^-1
        let mut m = MOD as i64;
        let mut u = 1i64;
        let mut v = 0i64;
        while m != 0 {
            let t = a / m;
            a -= t * m;
            swap(&mut a, &mut m);
            u -= t * v;
            swap(&mut u, &mut v);
        }
        u %= m;
        if u < 0 {
            u += m;
        }
        self * Mint(u as u32)
    }
}
impl std::ops::DivAssign for Mint {
    fn div_assign(&mut self, x: Mint) {
        *self = *self / x;
    }
}
impl std::fmt::Display for Mint {
    fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
        write!(f, "{}", self.0)
    }
}
impl Mint {
    pub fn pow(self, mut n: u32) -> Mint {
        let mut res = Mint(1);
        let mut r = self;
        while n > 0 {
            if n & 1 == 1 {
                res *= r;
            }
            r *= r;
            n >>= 1;
        }
        res
    }
    pub fn inv(self) -> Mint {
        assert!(self.0 != 0);
        self.pow(MOD - 2)
    }
}
fn facinit(n: u32) -> Vec<Mint> {
    let mut res = Vec::new();
    let mut k = Mint(1);
    res.push(k);
    for i in 1..n + 1 {
        k *= Mint(i);
        res.push(k);
    }
    res
}


Measured memory_bytes: 2940
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (int64_t)(n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

#define chmax(a, b) (a) = max(a, b)
#define chmin(a, b) (a) = min(a, b)

int main() {
  int K;
  cin >> K;
  vector<int> s = {1, 1, 1, 2, 1, 2, 1, 5,  2, 2, 1, 5, 1, 2, 1, 14,
                   1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  cout << s[K - 1] << endl;
  return 0;
}

Measured memory_bytes: 3072
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<numeric>
using namespace std;
const int dx[]={1,0,-1,0};
const int dy[]={0,1,0,-1};
#define INF 1e+8
#define EPS 1e-7
#define PB push_back
#define fi first
#define se second
#define ll long long
#define MOD 26
#define reps(i,j,k) for(int i = (j); i < (k); i++)
#define rep(i,j) reps(i,0,j)
typedef pair<int,int> Pii;
typedef vector<int> vi;
int main(){
    int n;
    scanf("%d%*c",&n);
    while(n--){
        string str;
        getline(cin,str);
        vector < string > target;
        rep(i,str.size()-3){
            string sub(str,i,4);
            if(i == 0){
                if(str[4] == ' ' || str[4] == '\0'){
                    if(str[0] != ' '&&str[1] != ' '&&str[2] != ' '&&str[3] != ' '){
                        target.PB(sub);
                    }
                }
            }
            else if(i == str.size()-4){
                if(str[str.size()-5] == ' '){
                    if(str[i] != ' '&&str[i+1] != ' '&&str[i+2] != ' '&&str[i+3] != ' '){
                        target.PB(sub);
                    }
                }
            }
            else{
                if(str[i-1] == ' ' && str[i+4] == ' '){
                    if(str[i] != ' '&&str[i+1] != ' '&&str[i+2] != ' '&&str[i+3] != ' '){
                        target.PB(sub);
                    }
                }
            }
        }
        string en = "abcdefghijklmnopqrstuvwxyz";
        string ans = "";
        int i = 0;
        int alpha;
        int beta;
        while(++i){
            if(i%2 == 0 || i%13 == 0)continue;
            rep(j,26){
                rep(k,target.size()){
                    string sub;
                    rep(l,4){
                        sub += en[((i*(target[k][l]-'a')+j) % MOD)];
                    }
                    if(sub == "this" || sub == "that"){
                        alpha = i;
                        beta = j;
                        goto end;
                    }
                }
            }
        }
        end:;
        rep(i,str.size()){
            if(str[i] == ' ')ans += " ";
            else ans += en[((alpha*(str[i]-'a')+beta) % MOD)];
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 1244