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 <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
using namespace std;

int main() {
  int w;
  for(;;) {
    cin >> w;
    if(w == -1) break;
    if(w <= 10) cout << 4280 - 1150 << endl;
    if(10 < w && w <= 20) {
      int payment = 1150 + (w - 10) * 125;
      cout << 4280 - payment << endl;
    }
    if(20 < w && w <= 30) {
      int payment = 1150 + 10 * 125 + (w - 20) * 140;
      cout << 4280 - payment << endl;
    }
    if(30 < w) {
      int payment = 1150 + 10 * 125 + 10 * 140 + (w - 30) * 160;
      cout << 4280 - payment << 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;
}

C++: #include<iostream>
using namespace std;
int main(){
  int w,ans;
  while(cin>>w){
    if(w==-1) break;
    ans = 1150;
    if(w>10&&w<=20) ans += (w-10) * 125;
    else if(w>=20) ans += 10 * 125;
    if(w>20&&w<=30) ans += (w-20) * 140;
    else if(w>30) ans += 10 * 140;
    if(w>30) ans += (w-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>
using namespace std;

int main() {

  int c = 4280;
  int a[3] = {125,140,160};
  int b = 1150;
  while(1) {

    int n;
    cin >> n;
    if(n == -1) break;

    b = 1150;
    if(n >=10 )n -= 10;
    else n = 0;
    int i =0;
    while(n >= 10){
      if(i == 3) i--;
      b += a[i]*10;
      n -= 10;
      i++;
      //    cout <<i<<" "<<n <<" "<< b<< endl;
     
    }
    // cout <<i << endl;
    if(i==3)i--;
    for(int j=0;j<n;j++) b +=a[i];
      
    cout << c - b << 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>
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;

C++: //#include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <utility>
#include <climits>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define F first
#define S second
#define OUT(x) cout << x << "\n"
using namespace std;
using point = pair< int,int >;
using ll = long long;

int main() {
    ll n;
    int ans, prev;

    while (~scanf("%lld", &n)) {
        if (n == -1) break;
        prev = 4280;
        ans = 1150;
        if (10 < n && n <= 20) {
            ans += (n - 10) * 125;
        } else if (20 < n && n <= 30) {
            ans += 1250 + (n - 20) * 140;
        } else if (30 < n) {
            ans += 1250 + 1400 + (n - 30) * 160;
        }
        OUT(prev - ans);
    }


    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<sstream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>

#define rep(i,n) for(int i=0;i<n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define rp(i,c) rep(i,(c).size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf=1<<28;
const double INF=1e12,EPS=1e-9;

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

C++: #include<iostream>
using namespace std;
int main()
{
	while(1){
		int w;
		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-(10*125)-((w-20)*140) << endl;
		}else{
			cout << 4280-1150-(10*125)-(10*140)-((w-30)*160) << endl;
		}
	}
	return 0;
}

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

int solve(int x) {
  int ret = 1150;
  if(x <= 10) return ret;
  if(x <= 20) {
    ret += (x-10)*125;
    return ret;
  }else if(x <= 30) {
    ret += (x-20)*140 + 1250;
    return ret;
  }else{
    ret += 1250 + 1400 + (x-30)*160;
    return ret;
  }
}

int main() {
  int i;
  while(cin>>i, (i != -1))
    cout<<4280-solve(i)<<endl;
}

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

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

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

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

int calc_fee(int w) {
    if (w <= 10) return 1150;
    if (10 < w && w <= 20) {
        return 1150 + (w - 10) * 125;
    } 
    if (20 < w && w <= 30) {
        return 1150 + 10 * 125 + (w - 20) * 140;
    }
    if (30 < w) {
        return 1150 + 10 * 125 + 10 * 140 + (w - 30) * 160;
    }
}

int main() {
    int n; int prev_fee = 4280;
    while (cin >> n, n != -1) {
        cout << - (calc_fee(n) - prev_fee) << endl;
    }
    return 0;
}