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 <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

int dx[]={1, 0, -1, 0};
int dy[]={0, -1, 0, 1};

int main(){
    while(1){
        int n; cin>>n;
        if(n == -1) return 0;

        int ans = 1150;
        if(10 < n && n <= 20) ans += (n - 10) * 125;
        if(20 < n && n <= 30) ans += (n - 20) * 140 + 1250;
        if(30 < n) ans += (n - 30) * 160 + 1400 + 1250;

        cout << 4280 - ans << endl;
    }
}

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 <complex>
#include <stack>
#include <queue>
#include <cstring>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;


int kakaku(int n){
	int value=0;
	value+=1150;
	n-=10;
	if(n>0)value+=125*n;
	n-=10
	if(n>0)value+=15*n;
	n-=10;
	if(n>0)value+=20*n;
	return value;
}

int main(){
	int sui,sen,kon;
	
	cin>>sui;
	if(sui==-1)return ;
	sen=kakaku(sui);
	
	
	while(cin>>sui){
		if(sui==-1)break;
		kon=kakaku(sui);
		cout<<kon-sen<<endl;
		sen=kon;
	}
	return 0;
}

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

int main(void){
     int data[100];
     int n,i=0;
     while(1){
	  cin >> n;
	  if(n==-1){
	       break;
	  }
	  if(n>30){
	       data[i] += (n-30)*160;
	       n -= (n-30);
	  }
	  switch(n){
	  case 30:
	  case 29:
	  case 28:
	  case 27:
	  case 26:
	  case 25:
	  case 24:
	  case 23:
	  case 22:
	  case 21:
	       data[i] += (n-20)*140;
	       n -= (n-20);
	  case 20:
	  case 19:
	  case 18:
	  case 17:
	  case 16:
	  case 15:
	  case 14:
	  case 13:
	  case 12:
	  case 11:
	       data[i] += (n-10)*125;
	       n -= (n-10);
	  case 0:
	  defult:
	       data[i] += 1150;
	  }

	  cout << 4280 - data[i] << endl;

	  i++;
     }

     return 0;
}

C++: #include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

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

int main() {
    const int lastMonth = 4280;
    while (true) {
        int w;
        cin >> w;
        if (w == -1) {
            break;
        }
        int fee = 1150;
        if (w > 10) {
            fee += (w - 10) * 125;
        }
        if (w > 20) {
            fee += (w - 20) * 15;
        }
        if (w > 30) {
            fee += (w - 30) * 20;
        }
        cout << lastMonth - fee << endl;
    }
}

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 %d\n",a,w);
	}
	return 0;
}

C++: //============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
#include <string>
#include <cctype>
using namespace std;

int main() {
	int W;
	int R;
	while(1){
		R=0;
		cin>>W;
		if(W==-1) break;
		if(W<=10)R=1150;
		else if(W>10&&W<=20)R=1150+(W-10)*125;
		else if(W>20&&W<=30)R=1150+1250+(W-20)*140;
		else if(W>30)R=1150+1250+1400+(W-30)*160;

		cout<<4280-R<<endl;
	}


	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    int water[] = {10, 20, 30, INT_MAX};
    int value[] = {125, 140, 160};

    for(;;){
        int w;
        cin >> w;
        if(w == -1)
            return 0;

        int ret = 1150;
        for(int i=0; i<3; ++i){
            if(w > water[i]){
                ret += (min(water[i+1], w) - water[i]) * value[i];
            }
        }
        cout << (4280 - ret) << endl;
    }
}

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


int calc(int w){
	int s=1150;
	w-=min(10,w);
	s += min(10,w)*125;
	w-=min(10,w);
	s += min(10,w)*140;
	w-=min(10,w);
	s += w*160;
	return s;
}

int main(){
	int w;
	while(cin>>w&&~w){
		cout<<4280-calc(w)<<endl;
	}
	return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

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

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int n;
	while(cin>>n){
		if(n==-1)break;
		//int a,b,c,d;
		int sum =4280-1150;
		if(n<=10){
			cout <<sum<<endl;
			continue;
		}else if(n>10&&n<=20){
			//sum -=10*125;
			sum -=(n-10)*125;
			cout <<sum<<endl;
			continue;
		}else if(n>20&&n <=30){
			sum -=10*125;
			//sum -=10*140;
			sum -=(n-20)*140;
			cout <<sum<<endl;
			continue;
		}else if(n>30){
			sum -=10*125;
			sum -=10*140;
			sum -=(n-30)*160;
			cout <<sum<<endl;
			continue;
		}
	}
	return 0;
}

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

int main()
{
	int w;

	cin >> w;

	while (w >= 0) {
		int f = 0;

		if (w <= 10)
			f = 1150;
		else if (w <= 20)
			f = 1150 + 125 * (w - 10);
		else if (w <= 30)
			f = 2400 + 140 * (w - 20);
		else
			f = 3800 + 160 * (w - 30);

		cout << 4280 - f << endl;

		cin >> w;
	}
	
	return 0;
}