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;
	int ryokin;

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


	return 0;

}

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

int calc(int n) {
	int sum = 1150;
	if (10 < n) sum += (n - 10) * 125;
	if (20 < n) sum += (n - 20) * 15;
	if (30 < n) sum += (n - 30) * 20;
	return sum;
}

int main() {
	int data;
	while (1) {
		cin >> data; if (data == -1) break;
		cout << 4280 - calc(data) << endl;
	}
	return 0;
}

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 << 4280 - price << endl;
	}
	
	return 0;
}

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

using namespace std;

int main()
{
	int w;

	while (1){
		int rs;

		scanf("%d", &w);
		if (w == -1){
			break;
		}

		if (w <= 10){
			rs = 1150;
		}
		else if (w <= 20){
			rs = 1150 + (w - 10) * 125;
		}
		else if (w <= 30){
			rs = 1150 + 1250 + (w - 20) * 140;
		}
		else if (30 < w){
			rs = 1150 + 1250 + 1400 + (w - 30) * 160;
		}

		cout << 4280 - rs << endl;
	}

	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 <algorithm>
#include <iostream>

using namespace std;

int main() {
  for (;;) {
    int w;
    cin >> w;
    if (w == -1) return 0;
    cout << 4280 - (1150 + 125*min(10, max(w-10, 0)) + 140*min(10, max(w-20, 0)) + 160*max(w-30, 0)) << 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<bits/stdc++.h>
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 mizu,kane,sa;
	kane=1150;
	while(1){
		cin >> mizu;
		if(mizu==-1) break;
		if(mizu>10 && mizu<=20){
			mizu=mizu-10;
			kane=kane+mizu*125;
		}else if(mizu>20 && mizu<=30){
			mizu=mizu-20;
			kane=kane+1250+mizu*140;
		}else if(mizu<=10){
			kane=1150;
		}else if(mizu>30){
			mizu=mizu-30;
			kane=kane+1250+1400+mizu*160;
		}
		
		cout << 4280-kane << endl;
		}
	
	return 0;
}

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

using namespace std;

int main(){
	for(int w;cin>>w,~w;){
		int p=1150;			w-=min(w,10);
		p+=125*min(w,10);	w-=min(w,10);
		p+=140*min(w,10);	w-=min(w,10);
		p+=160*w;
		cout<<4280-p<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
  while(true){
    int w;
    int val = 0;
    cin >> w;
    if( w == -1 ) break;
    
    val = 1150;
    int n = 0;
    int vs[] = {125,140,160};
    while(true){
      int t = w - 10*(n+1);
      if( t < 0 ) t = 0;
      if( t > 10 && n <= 2 ) t = 10;
      val += t * vs[n];
      ++n;
      if( n == 3 ) break;
    }
    cout << 4280 - val << endl; 
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
main(){
  int n;
  while(cin>>n && n>=0){
    int ans =1150;
    int tmp=n;
    int val=n-10;
    if (n >=10){
      if (n>=20)ans+=10*125;
      else ans+=(n-10)*125;
    }
    if (n >=20){
      if (n>=30)ans+=10*140;
      else ans+=(n-20)*140;
    }
    if (n >= 30)ans+=(n-30)*160;
    cout << 4280-ans << endl;
  }
}

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

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;} //&&c<='9'
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
//bool scan(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
template <typename head, typename... tail>
bool scan(head &h, tail&&... t){return scan(h) && scan(t...);}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
//vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo

struct T {
	int a[101];
	constexpr T() : a() {
		int s[10] = {0, 125, 140};
		for (int i = 3; i < 10; i++) s[i] = 160;
		for (int i = 0; i < 101; i++)
			a[i] = i <= 10 ? 1150 : a[i - 1] + s[(i - 1) / 10];
	}
};

int main() {
	constexpr T t;
	for (int w; ~(w = in());)
		out(4280 - t.a[w], '\n');
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>

using namespace std;

int v2( int n ) {
  if ( n <= 10 ) {
	return 140 * n;
  } else {
	return 1400 + 160 * ( n - 10 );
  }
}

int v1( int n ) {
  if ( n <= 10 ) {
	return 125 * n;
  } else {
	return 1250 + v2( n - 10 );
  }
}

int solve( int n ) {
  if ( n <= 10 ) {
	return 1150;
  } else {
	return 1150 + v1( n - 10 );
  }
}

int main() {
  while( true ) {
	int n;
	cin >> n;
	if ( n == -1 ) break;
	cout << 4280 - solve( n ) << endl;
  }  
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	while(1){
		int w,ans=3130;
		cin>>w;
		if(w==-1) break;
		if(w<=10){
			cout<<3130<<endl; continue;
		}
		w-=10;
		rep(i,0,10){
			if(w==0) break; ans-=125; w--; 
		}
		rep(i,0,10){
			if(w==0) break; ans-=140; w--;
		}
		rep(i,0,100){
			if(w==0) break; ans-=160; w--;
		}
		o(ans);
	}
}