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

int main(void)
{
    int w;
    
    while (1){
        int money = 0;
        
        scanf("%d", &w);
        if (w == -1) break;
        
        while (1){
            if (30 < w){
                money += 160;
            }
            else if (20 < w){
                money += 140;
            }
            else if (10 < w){
                money += 125;
            }
            else if (w == 0){
                money += 1150;
                break;
            }
            w--;
        }
        
        printf("%d\n", 4280 - money);
    }
    
    return (0);
}

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

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

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,cost;
  while(cin >> n&&n != -1){
    cost = 1150;
    n -= 10;
    if(n>=0){
      cost += ((n<10)? (n%10):10) * 125;
      n -= 10;
    }
    if(n >= 0){
      cost += ((n<10)? (n%10):10) * 140;
      n -= 10;
    }
    if(n >= 0){
      cost += n * 160;
    }
    cout << 4280 - cost << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    while(1){
	int w;
	int ans=0;
	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+1400+1250+(w-30)*160)<<endl;
    }
    return 0;
}

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

int main(void){
  while(1){
    int all;
    cin >> all;
    if(all == -1) break;
    else{
      if(all >10 && all < 20){
        all -= 10;
        all *= 125;
      }else if(all > 20 && all < 30){
        all -= 20;
        all *= 140;
        all +=1250; 
      }else if(all > 30 && all < 100){
        all -=30;
        all *= 160;
        all += 1250 + 1400;
      }
      all += 1150;
      cout << 4280 - all << 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-(a-10)*125-1150;
		y=4280-(a-20)*140-2400;
		v=4280-(a-30)*160-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;
	}
}

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

int main(){
	int a, w;
	while(true){
	cin >> w;
	if(w==-1)break;
	else if(w<=10)a=w*1150;
	else if(w>10 && w<=20)a=1150+(w-10)*125;
	else if(w>20 && w<=30)a=1150+10*125+(w-20)*140;
	else if(w>30)a=1150+10*125+10*140+(w-30)*160;

	cout << 4280-a << "\n";
	}
	return 0;
}

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

C++: using namespace std;
#include <iostream>
#include <string>
#include <set>
#include <functional>
#include <vector>
#include <algorithm>
#include <stdio.h>
int main()
{
	int n;
	while(cin>>n&&n!=-1){
		int ans=1150;
		if(10<n)ans+=min(10,(n-10))*125;
		if(20<n)ans+=min(10,(n-20))*140;
		if(30<n)ans+=min(10,(n-30))*160;
		cout<<4280-ans<<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<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<cmath>
#include<cstring>
using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(){
	while(1){
		int w = 0;
		cin >> w;
		if(w == -1) break;
		int nums[3] = {125,140};
		int ans = 1150;
		for(int i = 1;i <= 2;i++){
			if(w >= 10 * i) ans += min(w - (10 * i), 10) * nums[i - 1];
		}
		if(w >= 30) ans += (w - 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;
}