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<bits/stdc++.h>
using namespace std;
int main(){
  while(true){
    int w;
    cin>>w; if(w==-1) break;
    if(w<=10) cout<<4280-(1150)<<"\n";
    w-=10;
    if(w<=10 && w>=0) cout<<4280-(1150+w*125)<<"\n";
    w-=10;
    if(w<=10 && w>=0) cout<<4280-(1150+10*125+w*140)<<"\n";
    w-=10;
    if(w>=0) cout<<4280-(1150+10*125+10*140+w*160)<<"\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;
    w-=10;      
    
    for(int i=0;i<3;i++){
      if(w>9)w-=10,res+=10*a[i];
      else if(w<0)break;
      else{
	res+=w*a[i];
	break;
      }
    }
 
    cout << p-res << 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 <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif
#define LDcout(x,n) fixed<<setprecision(n)<<x

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int n;
	while(cin>>n){
		if(n==-1) return;
		int ans=1150;
		n=max(0,n-10);
		if(n){
			ans+=min(10,n)*125;
			n=max(0,n-10);
		}
		if(n){
			ans+=min(10,n)*140;
			n=max(0,n-10);
		}
		ans+=n*160;
		cout<<4280-ans<<endl;
	}
}


signed main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);
  	cout<<fixed<<setprecision(20);
    mainmain();
}

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

int main(){
	int n;
	while(cin>>n){
		int sum=0;
		while(n>9){
			if(30<n){;sum+=160*(n-30);n=30;}
			else if(20<n){sum+=140*(n-20);n=20;}
			else if(10<=n){sum+=125*(n-10);n=0;}
			//cout<<n<<" "<<sum<<endl;
		}
		sum+=1150;
		cout<<4280-sum<<endl;
	}

}

C++: #include<stdio.h>
int main(void)
{
	int sum,n,c,i;
	while(1){
		sum=1150;
		scanf("%d",&n);
		if(n<0)break;
		c=n-10;
		if(n>10){
			for(i=0;i<10;i++){
				if(c==0)break;
				sum+=125;
				c-=1;
			}
		}
		if(n>20){
			for(i=0;i<10;i++){
				if(c==0)break;
				sum+=140;
				c-=1;
			}
		}
		if(n>30){
			while(1){
				if(c==0)break;
				sum+=160;
				c-=1;
			}
		}
		printf("%d\n",4280-sum);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int a,x,y,v,k;
	scanf("%d",&a);
	while(1){
	    if (a<=0) 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>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
int main(){
    while(1){
	int w;
	cin >> w;
    if(w == -1) break;
    int sum = 0;
    if(w > 30){
        sum += 160*(w-30);
        w = 30;
    }
    if(w > 20){
        sum += 140*(w-20);
        w = 20;
    }
    if(w > 10){
        sum += 125*(w-10);
        w = 10;
    }
    if(w <= 10){
        sum += 1150;
    }
    cout << 4280-sum << endl;
    }
	return 0;
}

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

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

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;
}