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 <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n;
    int dif=4280;
    while(cin>>n){
        if(n==-1)break;
        int cost=1150;
        for(int i=1; i<=n;i++)
            if(i<=10)continue;
            else if(i<=20)cost+=125;
            else if(i<=30)cost+=140;
            else cost+=160;
        //cout<<cost<<endl;
        cout<<dif-cost<<endl;
    }
}

C++: // AOJ 0216
#include<iostream>

int w;
const int ps[3] = { 125, 140, 160 };

int main()
{
	while( std::cin >> w, w != -1 )
	{
		int ans = 1150;
	
		for( int i = 0; i != 3; ++i )
		{
			const int border = ( i + 1 ) * 10;
			
			if( w >= border )
				ans += ps[i] * ( i == 2 ? w - border : std::min( w - border, 10 ) ); 
		}

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

	return 0;
}

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

int main(){
	int w;
	while(cin >> w, w != -1){
		int fee = 1150;
		for(int i=11; i <= 20 && i <= w; i++) fee += 125;
		for(int i=21; i <= 30 && i <= w; i++) fee += 140;
		for(int i=31; i <= w; i++) fee += 160;

		cout << 4280 - fee << endl;
	}
}

C++: #include <iostream>

using namespace std;

int main() {
  int n;
  while(cin >> n && n >= 0) {
    int res = 3130;    
    for(int i=11; i<=n; i++) {
      if(i<=20) res -= 125;
      else if(i<=30) res -= 140;
      else res -= 160;
    }
    cout << res << endl;
  }
  
  return 0;
}

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

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

int main() {
  int month;
  while(cin >> month) {
    if(month == -1) break;
    if(month <= 10) {
      cout << 4280 - 1150 << endl;
      continue;
    }
    if(month <= 20) {
      cout << 4280 - 1150 - 125*(month-10) << endl;
      continue;
    }
    if(month <= 30) {
      cout << 4280 - 1150 - 1250 - 140*(month-20) << endl;
      continue;
    }
    cout << 4280 - 1150 - 1250 - 1400 - 160*(month-30) << endl;
    continue;
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

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();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#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 range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

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

C++: /*
	0216:Cutting Down Water Bills
*/
#include	<iostream>

using namespace std;

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

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
#include <iomanip>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
	int w;
	while(cin >> w && w + 1)
	{
		int dw[] = {125, 140, 160};
		int res = 1150;
		
		w -= 10;
		for(int i = 0; 0 < w--; i++)
			res += dw[i / 10];

		cout << 4280 - res << endl;
	}
}

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