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 w,mo;
  while(cin >> w,w!=-1){
  	mo=1150;
  	if(w>10){
  		w-=10;
  		if(w>10){
  			mo+=1250;
  			w-=10;
  			if(w>10){
  				mo+=1400;
  				w-=10;
  				if(w>0) mo+=w*160;
  			}
  			else{
  				mo+=w*140;
  			}
  		}
  		else{
  			mo+=w*125;
  		}
  	}
  	cout << 4280-mo << endl;
  	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define endl    '\n'
using namespace std;

typedef long long ll;

int main()
{
    int w, sum;

    cin >> w;

    while (w != -1) {
        sum = 1150;

        if (w > 10) {
            sum += 125 * (min(10, w - 10));
        }

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

        if (w > 30) {
            sum += 160 * (w - 30);
        }

        cout << 4280 - sum << endl;

        cin >> w;
    }

    return 0;
}

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

int main(void){
	int w;

	while(cin>>w && w != -1){
		int sum = 1150;

		for(int i=11;i<=w && i<=20;i++) sum += 125;
		for(int i=21;i<=w && i<=30;i++) sum += 140;
		for(int i=31;i<=w;i++) sum += 160;

		cout<<4280-sum<<endl;
	}

	return 0;
}

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

int main() {
	int w;
	while(cin >> w, w >= 0) {
		int sum = 0;
		sum += 1150;
		sum += 125 * max(0,w-10);
		sum += 15 * max(0,w-20);
		sum += 20 * max(0,w-30);
		cout << 4280-sum << endl;
	}
}

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

using namespace std;

int main() {
	int num, sum;

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

	return 0;
}

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

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

  }
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int w,c[]={125,140,160};

int main(){
	while(cin>>w){
		if(w==-1)return 0;
		if(w<=10)cout<<3130<<endl;
		else{
			w-=10;
			int p=0,C=1150;
			while(p<2&&w>10){C+=c[p]*10;p++;w-=10;}
			C+=c[p]*w;
			cout<<4280-C<<endl;
		}
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  
  int n;
  while(1){
    cin >>n;
    if(n == -1)break;
    int ans=0;
    if(n <= 10){
      ans = 1150;
    }
    else if(n/10 == 1 || n==20 ){
      ans = 1150 + n%10*125;
    }
    else if(n/10 == 2 || n==30){
      ans = 1150 + 10*125 + n%10*140;
    }
    else{
      ans = 1150 + 10*125 + 10 *140 + (n-30)*160;
    }
    cout << 4280-ans << endl;
    
  }
    return 0;
}

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

int w,sum;
string str;

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

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

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

		REP(i,1,w+1)
		{
			if(i <= 10) continue;
			else if(i <= 20) ans += 125;
			else if(i <= 30) ans += 140;
			else ans += 160;
		}

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

C++: #include <cstdio>

int main(){
	int n;
	while(scanf("%d",&n)){
		if(n==-1)break;
		if(n<=10)printf("%d\n",4280-1150);
		else{
			int price = 1150;
			if(n<=20){
				for(int i=0;i<n-10;++i){
					price+=125;
				}
				printf("%d\n", 4280-price);
			}else if(n<=30){
				price+=125*10;
				for(int i=0;i<n-20;++i){
					price+=140;
				}
				printf("%d\n",4280-price);
			}else {
				price += (125+140) * 10;
				for(int i=0;i<n-30;++i){
					price+=160;
				}
				printf("%d\n",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>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <sstream>

using namespace std;

int main (void)
{
	for (int u = 0; u < 200; u++)
	{
		int n;

		cin >> n;
		if (n == -1)
		{
			break;
		}

		if (n <= 10)
		{
			cout << 3130 << endl;
		}
		else if (n <= 20)
		{
			cout << 4280 - (1150 + ((n - 10) * 125)) << endl;
		}
		else if (n <= 30)
		{
			cout << 4280 - (2400 + ((n - 20) * 140)) << endl;
		}
		else
		{
			cout << 4280 - (3800 + ((n - 30) * 160)) << endl;
		}
	}
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a = 4280, b, sum, ans;
	while(true)
	{
		cin >> b;
		if (b == -1) break;
		if (b <= 10)
		{
			sum = 1150;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 10 && b <= 20)
		{
			sum = 1150 + (b-10) * 125;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 20 && b <= 30)
		{
			sum = 1150 + 1250 + (b - 20) * 140;
			ans = a - sum;
			cout << ans << endl;
		}
		if (b > 30)
		{
			sum = 1150 + 1250 + 1600 + (b - 30) * 160;
			ans = a - sum;
			cout << ans << endl;
		}
	}
}

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

C++: #include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    while(1){
        int a;
        cin>>a;
        if(a==-1)break;
        int ans=3130;
        ans-=125*min(10,max(0,a-10));
        ans-=140*min(10,max(0,a-20));
        ans-=160*max(0,a-30);
        cout<<ans<<endl;
    }
    return 0;
}

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

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