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++: /*
	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; }
		
		price += 1150;
		if(w >= 10 && w < 20) {
			price += (w-10) * 125;
		} else if(w < 30) {
			price += (w-20) * 140 + 1250;
		} else {
			price += (w-30) * 160 + 2650;
		}
		
		//cout << "[TEST]price = " << price << endl;
		cout << 4280 - price << endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
	int w,ans=0,mae=4280;
	while(cin>>w,w!=-1){
		if(w<10){
		ans=1150;
		}
		else if(w>=10&&w<20){
			ans=1150+125*(w-10);
		}
		else if(w>=20&&w<30){
			ans=1150+1250+140*(w-20);
		}
		else {
			ans=1150+1250+1400+160*(w-30);
		}
		cout<<mae-ans<<endl;
		//mae=ans;
		//ans=0;
	}
}

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

int main( void )
{
    const int base = 4280;
    int w, t;

    while ( cin >> w && w >= 0 )
    {
        int pay = 1150;
        w = max( w - 10, 0 );

        if ( w > 0 )
        {
            t = w > 9 ? 10 : w;
            pay += t * 125;
            w = max( w - t, 0 );
        }

        if ( w > 0 )
        {
            t = w > 9 ? 10 : w;
            pay += t * 140;
            w = max( w - t, 0 );
        }

        if ( w > 0 )
        {
            pay += w * 160;
            w = 0;
        }
        
        cout << base - pay << endl;
    }

    return 0;
}

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

int main()
{
	int last = 4280;
	int w;
	int mon=0;
	while(cin >> w){
		mon = 1150;
		if(w<0)
			break;
		for(int i=1;i<=w;i++){
			if(i<=10)
				mon=1150;
			else if(10<i && i<=20)
				mon+=125;
			else if(20<i && i<=30)
				mon+=140;
			else
				mon+=160;
		}
		cout << last-mon << endl;
	}
	return 0;
}

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

int main()
{
	int w;
	while(cin >> w, w>=0)
	{
		int a = 4280-1150;
		
		if(w>30)
		{
			a -= (w-30)*160;
			w  = 30;
		}
		if(w>20)
		{
			a -= (w-20)*140;
			w  = 20;
		}
		if(w>10)
		{
			a -= (w-10)*125;
		}

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

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

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

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

int main()
{
    int w, b = 4280;

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

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

C++: #import<cstdio>
int main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int, int> P;

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

        int cost = 1150;
        if (10 < w && w <= 20) cost += 125*(w-10);
        if (20 < w && w <= 30) cost += 1250+140*(w-20);
        if (30 < w) cost += 2650+160*(w-30);

        int ans = 4280-cost;
        cout << ans << endl;
    }

    return 0;
}

C++: #include "bits/stdc++.h"
#define rep(i,a,n) for(int (i) = (a);(i) < (n);(i)++)
using namespace std;

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;
using ll = long long;

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

const ll INF=1e9;
const ll MOD=1e9+7;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int w;
int p = 4280;

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

    cout << 4280 - sum << endl;
}

int main() {
    while(cin>>w) {
        if(w == -1) break;
        solve();
    }
    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;
	}

}