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>
using namespace std;

int main() {

  int c = 4280;
  while(1) {

    int n;
    cin >> n;
    if(n == -1) break;
    
    int b = 1150;
    int flg = 0;
    if(n >= 20) b += 125 * 10;
    else  flg = 125;
    if(n >= 30) b += 140*10;
    else if(flg == 0) flg = 140;
    if(n >= 40) {
      for(int i=0;i<(n-30)/10;i++) b += 160*10;
      flg = 160;
    }
    for(int i=0;i<n%10;i++) b += flg;
    
    cout <<c- b << endl;


  }

  return 0;

}

C++: #include <cstdio>

int Solve(int w){
	int c = 1150;
	if(w > 30){
		c += (w - 30) * 160;
		c += 140 * 10;
		c += 125 * 10;
	}else if(w > 20){
		c += 140 * (w - 20);
		c += 125 * 10;
	}else if(w > 10){
		c += 125 * (w - 20);
	}
	return c;
}

int main(){
	int self;
	//int bf;
	while(1){
	
		scanf("%d",&self);
		if(self == -1){break;}
		printf("%d\n",4280 - Solve(self));
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
#define LAST 4280
int main(){
    int w;
    while(cin >> w){
        if (w==-1)
            break;
        if(w<=10)
            cout << LAST-1150 << endl;
        if(10 <w && w<=20)
            cout << LAST-(1150+(w-10)*125) << endl;
        if(20<w && w<=30)
            cout << LAST-(2400+(w-20)*140) << endl;
        if(30<w)
            cout << LAST-(3800+(w-30)*160) << endl;
    }
}

C++: #include<iostream>
using namespace std;
int main(){
  int w;
  while(1){
  int m=3130;
    cin >> w;
    if(w==-1)break;
    w-=10;
    for(int i=0;w>0;i++){
      if(i<10)m-=125;
      if(i>=10&&i<20)m-=140;
      if(i>=20&&i<30)m-=160;
      if(i>=30)m-=160;
      w--;
    }
    cout << m << endl;
  }
  return 0;
}

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

int main(){
	int n;
	while(cin>>n){
		int sum=0;
		while(n>10){
			if(30<n){n--;sum+=160;}
			else if(20<n){n--;sum+=140;}
			else if(10<=n){n--;sum+=125;}
			//cout<<n<<" "<<sum<<endl;
		}
		sum+=1150;
		cout<<4280-sum<<endl;
	}

}

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

int main()
{
    int n, sum;
    for (; ; ) {
        scanf("%d", &n);
        if (n == -1) break;
        sum = 1150;
        if (n > 30) sum += (n - 30) * 160, n-= n-30;
        if (n > 20) sum += (n - 20) * 140, n -= n-20;
        if (n > 10) sum += (n - 10) * 125, n -= n-10;
        printf("%d\n", 4280-sum);
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

const int p=4280,a[3]={125,140,160};

int main(void){

int w;

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

int res=1150;

for(int i=0;i<3;i++){
w-=10;
if(w<0)break;
res+=w%11*a[i];
}
cout << res-p << endl;
}

return 0;
}

C++: /*
 * src.cpp
 *
 *  Created on: 2016/08/04
 *      Author: joi
 */

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

int main(){
	int w;
	do{
		cin>>w;
		if (w!=-1){
			int b;
			if (w<10){
				b=1150;
			}else if (w<20){
				b=1150+125*(w-10);
			}else if (w<30){
				b=1150+125*10+140*(w-20);
			}else{
				b=1150+125*10+140*10+160*(w-30);
			}
			cout<<4280-b<<endl;
		}
	}while (w!=-1);
	return 0;
}

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

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

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

using namespace std;

int main() {

	int w, m;

	while(cin >> w) {
		if(w==-1)
			break;
		m=0;
		if(w>=30) {
			m+=abs((double)(30-w))*160;
			w-=abs((double)(30-w));
		}
		if(w>=20) {
			m+=abs((double)(20-w))*140;
			w-=abs((double)(20-w));
		}
		if(w>=10) {
			m+=abs((double)(10-w))*125;
			w-=abs((double)(10-w));
		}
		if(w<=10)
			m+=1150;
		cout << 4280-m << endl;
	}

	return 0;

}

C++: #include<iostream>
using namespace std;
int main()
{
  int w,x=0;
  cin>>w;
  while(w!=-1){
    if(w<=10){
      x=1150;
    }else if(w>10&&w<=20){
      x=1150+(w-10)*125;
    }else if(w>20&&w<=30){
      x=1150+10*125+(w-20)*140;
    }else{
      x=1150+10*125+10*140+(w-30)*160;
    }
    cout<<4280-x<<'\n';    
    cin>>w;
  }
  return(0);
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<eps)
int money(int w)
{
	return 1150+max(min(w,20)-10,0)*125+max(min(w,30)-20,0)*140+max(w-30,0)*160;
}
int main()
{
	while(1)
	{
		int n;
		cin >> n;
		if(n==-1)break;
		cout << 4280-money(n) << endl;
	}
	return 0;
}

C++: // 2011/07/05 Tazoe

#include <iostream>
using namespace std;

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

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

		cout << 4280-bil << endl;
	}

	return 0;
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

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

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main() {
    int n;
    while(cin>>n){
        if(n<0)break;
        int sum=1150;
        if(n<=10)goto end;
        
        if(10<n && n<=20){
            sum+=(n-10)*125;
            goto end;
        }
        else sum+=125*10;
        
        if(20<n && n<=30){
            sum+=(n-20)*140;
            goto end;
        }
        else sum+=140*10;
        
        sum+=(n-30)*160;
        
        end:;
        cout<<4280-sum<<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<stdio.h>
int main(void)
{
	int a,b,s,ss;
	for(a=0;a<100;a++){
		scanf("%d",&a);
		if(a<=10){
			s=1150;
		}
		else if(a<=20){
			s=1150+125*(a-10);
		}
		else if(a<=30){
			s=1150+1250+140*(a-20);
		}
		else if(a<=40){
			s=1150+1250+1400+160*(a-30);
		}
		ss=4280-s;
		printf("%d\n",ss);
	}
	return 0;
}