Go: package main

import (
	"bufio"
			"os"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

const (
	LAST_MONTH = 4280
	BASE = 1150
)

func main() {
	for scanner.Scan() {
		w, _ := strconv.Atoi(scanner.Text())
		if w < 0 {
			break
		}
		s := BASE
		if  10 < w {
			if w <= 20 {
				s+= (w-10)*125
			} else {
				s+= 1250
			}
		}
		if 20 < w {
			if w <= 30 {
				s += (w-20)*140
			} else {
				s += 1400
			}
		}
		if 30 < w {
			s += (w-30)*160
		}
		fmt.Println(LAST_MONTH-s)
	}
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int n;
  while (cin >> n, n != -1) {
    int cost = 1150;
    n        = max(0LL, n - 10);
    cost += min(10LL, n) * 125;
    n = max(0LL, n - 10);
    cost += min(10LL, n) * 140;
    n = max(0LL, n - 10);
    cost += n * 160;
    cout << 4280 - cost << endl;
  }
}

C++: #include<iostream>
using namespace std;
int main(){
	int now,sum;
	while(cin>>now,now!=-1){
		sum=1150;
		now-=10;
		if(now>0){
			sum+=(now*125);
			now-=10;
		}
		if(now>0){
			sum+=(now*15);
			now-=10;
		}
		if(now>0){
			sum+=(now*20);
		}
		cout<<4280-sum<<endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>

using namespace std;

int main()
{
	int w;

	while (1){
		int rs;

		scanf("%d", &w);
		if (w == -1){
			break;
		}

		if (w <= 10){
			rs = 1150;
		}
		else if (w <= 20){
			if (w == 20){
				rs = 1150 + 1250;
			}
			else {
				rs = 1150 + (w % 10) * 125;
			}
		}
		else if (w <= 30){
			if (w == 30){
				rs = 1150 + 1250 + 1400;
			}
			else {
				rs = 1150 + 1250 + (w % 10) * 140;
			}
		}
		else if (30 < w){
			rs = 1150 + 1250 + 1400 + (w % 30) * 160;
		}

		cout << 4280 - rs << endl;
	}

	return (0);
}

C++: #include <cstdio>
using namespace std;
int main() {
	int w;
	while(scanf("%d",&w),w!=-1) {
		int sum=1150;
		if(w>=30) {
			sum+=(w-30)*160;
			w=30;
		}
		if(w>=20) {
			sum+=(w-20)*140;
			w=20;
		}
		if(w>=10) {
			sum+=(w-10)*125;
			w=10;
		}
		printf("%d\n",4280-sum);
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> P;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  int w,sengetu=4280;
  while(cin>>w){
    int ryokin=1150;
    if(w==-1) break;
    if(w>10) ryokin+=min(w-10,10)*125;
    if(w>20) ryokin+=min(w-20,10)*140;
    if(w>30) ryokin+=(w-30)*160;
    cout<<-(ryokin - sengetu)<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <cstring>
#include <cmath>

using namespace std;

int main(int argc, char *argv[]) {
  int w, fee;
  int ryoukin[] = {0, 125, 140, 160};
  const int Kihon = 1150;
  const int Bef = 4280;

  while (true) {
    cin >> w;
    if (w == -1)
      break;
    fee = Kihon;
    for (int i = 3; i > 0; i--) {
      fee += (w > i * 10 ? w - i * 10 : 0) * ryoukin[i];

      w -= w > i * 10 ? w - i * 10 : 0;
    }
    cout << Bef - fee << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
  int w;


  while(cin >> w , w != -1){

    int k = 1150;
    if(w <= 10){
      cout << 4280 - k << endl;
    }
    if(w > 10){
      for(int i = 0; i < min(w-10, 10) ; i++){
	k += 125;
      }
    }
    if(w > 20){
      for(int i = 0; i < min(w-20, 10)  ; i++){
	k += 140;
      }
    }
    if(w > 30){
      for(int i = 0; i < w-30 ; i++){
	k += 160;
      }
    }
    if(w > 10) cout << 4280-k << endl;


  }

  return 0;

}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	for (int w; cin >> w&&w != -1;) {
		int ans = 1150;
		int a[] = { 125,140,160 };
		rep(i, 0, 3) {
			if (w > 10) {
				w -= 10;
				if (i == 2)ans += a[i] * w;
				else ans += a[i] * (w >= 10 ? 10 : w % 10);
			}
		}
		ans = 4280 - ans;
		cout << ans << endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a,d;
	scanf("%d",&d);
		while(d!=-1){
			if(10>d){
				printf("%d\n",4280-1150);
			}
			if(10<=d && 20>d){
				printf("%d\n",4280-(1150+(d-10)*125));
			}
			if(20<=d && 30>d){
				printf("%d\n",4280-(1150+10*125+(d-20)*140));
			}
			if(30<=d){
				printf("%d\n",4280-(1150+10*125+10*140+(d-30)*160));
			}
		scanf("%d",&d);
		}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
 
int main(void)
{
  while(1){
    int rate;
    cin >> rate;
    if(rate == -1) break;
    else{
      if(rate==0){
        rate==0;
      }
      else{
        rate-=10;
      }
      while(1){
        if(rate >=0 && rate < 10){
          rate*=125;
          break;
        }else if(rate >= 10 && rate < 20){
          rate-=10;
          rate*=140;
          rate+=1250;
          break;
        }else if(rate >= 20 && rate < 30){
          rate-=20;
          rate*=160;
          rate+=2650;
          break;
        }else if(rate >= 30){
        rate = 4250;
      }
      rate+=1150;
      cout << 4280-rate << endl;
    }
  }
}

C++: #include<iostream>
using namespace std;

int main(){
	

	while(1){
		int w,w1,w10,ne[]={125,140,160},sum=1150;
		
		cin >> w;
		if(w<0){
			break;
		}
		w10=w/10;w1=w-w10*10;
		if(w10>=3){
			w10=3;
		}
		sum=sum+w1*ne[w10-1];
		for(int i=0;i<w10-1;i++){
			sum=sum+10*ne[i];
		}
		if(w>=30){
			sum=sum+ne[2]*(w-30);
		}
		cout << 4280-sum << endl;
	}
	return 0;
}