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++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int w;

int main(){
	while (cin >> w&&w != -1){
		int sum = 1150;
		if (w > 30){
			sum += (w - 30) * 160;
		}
		if (w > 20){
			sum += min(10, w - 20) * 140;
		}
		if (w > 10){
			sum += min(10, w - 10) * 125;
		}
		cout << 4280 - sum << endl;
	}
}

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

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

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

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

const double EPS = 1e-8;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	int w;
	while (scanf("%d", &w), w != -1)
	{
		int charge = 1150;
		if (w > 10)
			charge += 125 * min(10, w - 10);
		if (w > 20)
			charge += 140 * min(10, w - 20);
		if (w > 30)
			charge += 160 * (w - 30);
		printf("%d\n", 4280 - charge);
	}

	return 0;
}

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

int main(void){
  while(1){
    int all;
    cin >> all;
    if(all == -1) break;
    else{
      if(all < 10){
        all =0;
      }
      if(all >10 && all < 20){
        all -= 10;
        all *= 125;
      }else if(all > 20 && all < 30){
        all -= 20;
        all *= 140;
        all +=1250; 
      }else if(all > 30 && all <= 100){
        all -=30;
        all *= 160;
        all += 1250 + 1400;
      }
      all += 1150;
      cout << 4280 - all << endl;
    }
  }
}

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

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

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

int main(void) {
  int v = 4280;
  int w, sum, ans;
  while(cin >> w, w != -1) {
    sum = 0;
    if(w < 10) sum += 1150;
    if(10 <= w && w < 20) {
      sum += 1150;
      sum += (w % 10) * 125;
    }
    if(20 <= w && w < 30) {
      sum += 2400;
      sum += (w % 10) * 140;
    }
    if(30 <= w) {
      sum += 3800;
      sum += (w - 30) * 160;
    }
    ans = v - sum;
    cout << ans << endl;
  }
  return 0;
}

C++: 
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
int a=0,b=0,c=0,d=0;
while (true) {
  std::cin >> n;
  if(n==-1)break;
if(n<=10)std::cout << 4280-1150 << '\n';
else if(n<=20)std::cout << 4280-(1150+(n-10)*125) << '\n';
else if(n<=30)std::cout << 4280-(1150+1250+(n-20)*140) << '\n';
else std::cout << 4280-(1150+1250+1400+(n-30)*160) << '\n';
}
}

C++: #include<iostream>
using namespace std;
int money(int m){
int money=1150;
//if(m==-1)return 0;
if(m<=10)return money;
if(m<=20&&m>10)return money+125*(m-10);
if(m<=30&&m>20)return money+10*125+140*(m-20);
if(m>30)return money+10*125+10*140+160*(m-30);
}
int main(){
int w;
while(true){
cin>>w;
if(w==-1)return 0;
cout<<4280-money(w);
}
}

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

using namespace std;

int main()
{
	int W;

	while (true)
	{
		cin >> W;

		if (W == -1) { break; }

		int money = 1150;

		if (W > 10)
		{
			money += min(W - 10, 10) * 125;
		}
		if (W > 20)
		{
			money += min(W - 20, 10) * 140;
		}
		if (W > 30)
		{
			money += (W - 30) * 160;
		}

		cout << 4280 - money << endl;
	}

	return 0;
}

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

C++: #include<iostream>
using namespace std;
int main() {
	int n;
	while (cin >>  n&&n != -1) {
		int sum = 0;
		sum += 1150;
		n -= 10;
		if (n>0) {
			if (n <= 10)
				sum += (n * 125);
			else
				sum += 1250;
			n -= 10;
		}
		if (n>0) {
			if (n <= 10)
				sum += (n * 140);
			else
				sum += 1400;
			n -= 10;
		}
		if (n > 0) {
			sum += (n * 160);
		}
		cout << 4280 - sum << endl;
	}
}

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

using namespace std;
typedef long long ll;

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