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 <cstdio>
#include <utility>
#include <vector>
using namespace std;

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;} //&&c<='9'
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
//bool scan(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
template <typename head, typename... tail>
bool scan(head &h, tail&&... t){return scan(h) && scan(t...);}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
//vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo

int main() {
	vector<int> s(10, 160), t(101, 1150);
	s = {0, 125, 140};
	for (int i = 10; i < 101; i++)
		t[i] = t[i - 1] + s[(i - 1) / 10];
	for (int w; ~(w = in());)
		out(4280 - t[w], '\n');
}

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

C++: #include<bits/stdc++.h>
#define endl '\n'
#define INF (1 << 21)
const int MOD = 1000000009;
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int w;
  int cnt = 4280;
  int ans;
  
  cin >> w;

  while(w != -1){
    if(w <= 10){
      ans = cnt - 1150;
    }else if(w <= 20){
      w -= 10;
      ans = cnt - (1150 + 125 * w);
    }else if(w <= 30){
      w -= 20;
      ans = cnt - (1150 + 125 * 10 + 140 * w);
    }else{
      w -= 30;
      ans = cnt - (1150 + 125 * 10 + 140 * 10 + 160 * w);
    }

    cout << ans << endl;
    cin >> w;
  }
  return 0;
}

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

#define rep_(v, f, l) for (int v = (f); v < (l); ++v)
#define rep(v, n) rep_(v, 0, n)
#define lep(v, n) rep_(v, 1, n + 1)

using namespace std;

typedef long long int lint;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

int calc_price(int w)
{
    int cost = 1150;
    if (w <= 10) return cost;
    if (w <= 20) return cost + (w - 10) * 125;
    cost += 1250;
    if (w <= 30) return cost + (w - 20) * 140;
    cost += 1400;
    return cost + (w - 30) * 160;
}

int main()
{
    int w;
    while (w = in(), ~w){
        printf("%d\n", 4280 - calc_price(w));
    }
    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(){
	int w,r;
	while(1){
	cin >> w;
	if(w<=10)r = 4280-1150;
	else if(10<w<=20)r = 4280 - (1150 + (w-10) * 125);
	else if(20<w<=30)r = 4280 - (1150 + 1250 + (w-20) * 140);
	else if(30<w)r = 4280 - (1150 + 1250 + 1400 + (w-30) * 160);

	else if(w==-1)break;

	cout << r << "\n";
	}

	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<2;i++){
w-=10;
if(w<0)break;
if(w%10==0)res+=10*a[i];
else res+=w%10*a[i];
}
if(w>0)res+=w*a[2];
cout << p-res << endl;
}
     
return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	while(true){
		int w;
		cin >> w;
		if(w==-1)
			break;

		int x=0,y=0;
		
		if(w>=0 && w<10)
			y = 1150;
		else if(w>=10 && w<20){
			x = w-10;
			y = 1150 + 125*x;
		}
		else if(w>=20 && w<30){
			x = w-20;
			y = 1150 + 125*10 + 140*x;
		}
		else if(w>=30){
			x = w-30;
			y = 1150 + 125*10 + 140*10 + 160*x;
		}

		cout << (4280 - y) << 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;
}

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

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

C++: #include <iostream>

using namespace std;

int main(int argc, char** argv)
{
	int w;
	int fare;

	while( 1 )
	{
		cin >> w;
		if(w==-1) break;
		
		fare = 0;
		if(w > 10) fare += 1150, w -= 10;
		
		if(w > 10) fare += 1250, w -= 10;
		else fare += w * 125, w = 0;

		if(w > 10) fare += 1400, w -= 10;
		else fare += w * 140, w = 0;

		fare += w * 160;

		cout << 4280 - fare << endl;		
	}
}

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

int main(void)
{
	int n;
	int d[3] = {125,140,160};

	while(cin >> n, n >= 0){
		int mon = 1150;
		n -= 10;

		for(int i = 0; i < 10 && n > 0; i++,n--){
			mon += d[0];
		}
		for(int i = 0; i < 10 && n > 0; i++,n--){
			mon += d[1];
		}
		for(int i = 0; n > 0; i++,n--){
			mon += d[2];
		}

		cout << 4280 - mon << endl;
	}


	return 0;
}

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

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

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