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<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	for (int w; cin >> w&&w != -1;) {
		int ans = 1150;
		int a[] = { 125,140,160 };
		rep(i, 0, 3) {
			if (w > 10) {
				w -= 10;
				ans += a[i] * (w >= 10 ? 10 : w % 10);
			}
		}
		ans = 4280 - ans;
		cout << ans << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
  int n;
  while( cin >> n, n != -1 ) {
    int sum = 1150;
    for(int i=11; i<=n; i++) {
      if( i > 30 ) sum += 160;
      else if( i > 20 ) sum += 140;
      else if( i > 10 ) sum += 125;
    }

    cout << 4280 - sum << endl;
  }
}

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");
			}
		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(30<=t){
			s=t-30;
			g=4280-((s*160)+3800);
			printf("%d\n",g);
		}	
	}
	return 0;
}

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

C++: #include <iostream>

#define MIN(X,Y) ((X)<(Y)?(X):(Y))
using namespace std;

const int lastMonth = 4280;

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

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

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

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

C++: #include<iostream>
#include<cstdio>
#include <cstring>
#include<map>
#include<string>
#include<stack>
#include <sstream>
#include<vector>
using namespace std;

int ryoukin(int n){
	int ans;
	if(n<=10) ans=1150;
	else if(n<=20) ans=1150+ ((n-10)*125);
	else if(n<=30) ans= 1150 + 1250 + ((n-20)*140);
	else ans = 1150 + 1250 + 1400 + ((n-30)*160);
	return ans;
}


int main(){
	int n;
	while(cin>>n)
	{
		if(n==-1) break;
		cout<< 4280-ryoukin(n) <<endl;
	}
	return 0;
}

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

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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

typedef unsigned long long UInt64;
typedef long long Int64;

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

using namespace std;

typedef pair<int ,int > P;

int f(int w)
{
	int res=1150;
	
	if(w<10) return res;
	if(w<20) return (res+(w%10)*125);
	if(w<30) return (res+1250+(w%10)*140);
	if(w<40) return (res+1250+1400+(w%10)*160);
	else return (res+1250+1400+1600+(w-40)*160);

}

int main()
{
	int w;
	while(cin>>w)
	{
		if(w==-1) return 0;
		cout<<4280-f(w)<<endl;
	}
		return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int w;
	while(cin >> w, w != -1)
	{
		int sum = 1150;
		if(w >= 20)
		{
			sum += 1250;
			if(w >= 30)
			{
				sum += 1400 + 160 * (w - 30);
			}
			else
			{
				sum += 140 * (w - 20);
			}
		}
		else if(w >= 10)
		{
			sum += 125 * (w - 10);
		}
		cout << 4280 - sum << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;

int main(){
    int bef = 4280, n;
    while(cin >>n && n != -1){
        int aft = 1150;
        n = max(0, n - 10);
        REP(i, 10){
            if(!n) break;
            aft += 125;
            n--;
        }
        REP(i, 10){
            if(!n) break;
            aft += 140;
            n--;
        }
        aft += (n * 160);
        cout <<bef - aft<<endl;
    }
    return 0;
}

C++: #include <cstdio>


int w;

int main(){
    while(scanf("%d", &w) != EOF){
        if(w == -1) break;


        if(w <= 10){
            printf("%d\n", 4280 - 1150);
        }else if(w <= 20){
            printf("%d\n", 4280 - (1150 + (w - 10) * 125));
        }else if(w <= 30){
            printf("%d\n", 4280 - (1150 + 1250 + (w - 20) * 140));
        }else if(w >  30){
            printf("%d\n", 4280 - (1150 + 1250 + 1400 + (w - 30) * 160));
        }
    }

    return 0;
}

C++: #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] * std::min( w - border, 10 ); 
		}

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

	return 0;
}