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

Python: while True:
  n=int(input())
  if n==-1:
    break
  a=4280
  b=1150
  if n<=10:
    print(a-b)
  elif 10<n<=20:
    print(a-(b+(n-10)*125))
  elif 20<n<=30:
    print(a-(b+1250+(n-20)*140))
  else:
    print(a-(b+1250+1400+(n-30)*160))

Python: while 1:
    w= int(input())
    if w== -1: break
    a= 1150
    if w> 10 and w<= 20:
        a+= (w-10)*125
    elif w> 20 and w<= 30:
        a+= (w-20)*140+ 1250
    elif w> 30:
        a+= (w-30)*160+ 1400+ 1250
    print(4280-a)

Python: while True:
    w = int(input())
    if w == -1: break
    last = 4280
    if w <= 10:
        a = 1150
    elif w <= 20:
        a = 1150 + (w-10)*125
    elif w <= 30:
        a = 1150 + 10*125 + (w-20)*140
    else:
        a = 1150 + 10*125 + 10*140 + (w-30)*160
    print(last - a)

Python: def f(w):
    if w <= 10:
        return 4280 - 1150
    elif w <= 20:
        return 4280 - (1150 + f1(w - 10))
    elif w <= 30:
        return 4280 - (1150 + f1(10) + f2(w - 20))
    else:
        return 4280 - (1150 + f1(10) + f2(10) + f3(w - 30))


def f1(x):
    return x * 125


def f2(x):
    return x * 140


def f3(x):
    return x * 160


while True:
    _w = int(input())
    if _w == -1:
        break
    print(f(_w))

Python: while True:
    w = int(input())
    if w == -1:
        break
    ans = 1150
    w = max(w-10,0)
    ans += min(w,10)*125
    w = max(w-10,0)
    ans += min(w,10)*140
    w = max(w-10,0)
    ans += w*160
    print(4280-ans)

Python: while True:
  w = int(input())
  if w == -1:
    break
  
  if w <= 10:
    price = 1150
  elif 10 < w <= 20:
    price = 1150 + (w - 10) * 125
  elif 20 < w <= 30:
    price = 2400 + (w - 20) * 140
  else:
    price = 3800 + (w - 30) * 160
    
  print(4280 - price)

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(){
  int n;
  while(1){
    cin >> n;
    if(n == -1)break;
    int num = 4280;
    int t,t2,t3,t4;
     t2=t3=t4=0;
     t = 1150;
     if(10 < n&&n <= 20){
       t2 = n-10;
     }else if(20 < n&&n <= 30){
       t2 = 10;
       t3 = n-20;
     }else if(30 < n){
       t2 = 10;
       t3 = 10;
       t4 = n-30;
     }
    int ans = t + t2*125 + t3*140 + t4*160;
    cout << num-ans << endl;
  }
  return 0;
}

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

int main(){
    int w;
    while(cin >> w){
        if(w == -1) break;

        int ans = 1150;
        ans += max(0, min(w-10 , 10)) * 125;
        ans += max(0, min(w-20 , 10)) * 140;
        ans += max(0, w-30) * 160;

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

C++: // 2013/09/09 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int w;
		cin >> w;

		if(w==-1)
			break;

		int b;
		if(w<=10){
			b = 1150;
		}
		else if(w<=20){
			b = 1150+(w-10)*125;
		}
		else if(w<=30){
			b = 1150+10*125+(w-20)*140;
		}
		else{
			b = 1150+10*125+10*140+(w-30)*160;
		}

		cout << 4280-b << endl;
	}

	return 0;
}

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 0;
	sen=kakaku(sui);
	
	
	while(cin>>sui){
		if(sui==-1)break;
		kon=kakaku(sui);
		cout<<kon-sen<<endl;
		sen=kon;
	}
	return 0;
}

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

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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int main() {
	int w;
	
	while (cin >> w) {
		if (w == -1) break;
		
		int price = 1150;
		
		for_(i,11,w+1) {
			if (i > 10 && i <= 20) price += 125;
			if (i > 20 && i <= 30) price += 140;
			if (i > 30) price += 160;
		}
		
		cout << 4280 - price << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
		int n,t,i,k,j,g,s,r,a,w,z,o;
	while(1)	{
		scanf("%d",&t);
		if(t==-1)	break;
		if(10>=t){
			printf("3130\n");
			}
		if(t>10&&t<20){
			n=t-10;
			i=4280-(n*125+1150);
			printf("%d\n",i);
			}
		if(t>20&&t<30){
			k=t-20;
			j=4280-((k*140)+2400);
			printf("%d\n",j);
		}
		if(t>30){
			s=t-30;
			g=4280-((s*160)+3800);
			printf("%d\n",g);
		}	
	}
	return 0;
}

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

using namespace std;

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

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

int main()
{
  int w;
  while (cin >> w) {
    if (w == -1)
      break;

    int price = 1150;
    w -= 10;
    if (w > 0) {
     price += 125 *  min(w, 10);
     w -= min(w, 10);
    }

    if (w > 0) {
     price += 140 *  min(w, 10);
     w -= min(w, 10);
    }

    if (w > 0)
      price += 160 * w;

    cout << 4280 - price << endl;
  }
  return 0;
}

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

C++: #include <bits/stdc++.h>
#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
using Graph=vector<vector<int>>;

int main(){
  vector<int> l;
  for(int i=0;i<220;i++){
    int n;cin>>n;
    int sum=1150;
    if(n==-1) break;
    if(n>30){
      int t=n-30;
      sum+=t*160;
      n-=t;
    }
    if(n>20){
      int t=n-20;
      sum+=t*140;
      n-=t;
    }
    if(n>10){
      int t=n-10;
      sum+=t*125;
      n-=t;
    }
    int resu=4280-sum;
    l.pb(resu);
  }
  for(int i=0;i<l.size();i++){
    cout<<l[i]<<endl;
  }
}