Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"strings"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	tbl := []int{600, 800, 1000, 1200, 1400, 1600}
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		if n == 0 {
			 break
		}
		fee := 0
		for i := 0; i < n; i++ {
			scanner.Scan()
			buf := strings.Split(scanner.Text(), " ")
			x, _ := strconv.Atoi(buf[0])
			y, _ := strconv.Atoi(buf[1])
			h, _ := strconv.Atoi(buf[2])
			w, _ := strconv.Atoi(buf[3])
			s := x + y + h
			if s <= 160 && w <= 25 {
				k1, k2 := 0, 0
				if s <= 60 {
					k1 = 0
				} else {
					k1 = (s-61)/20 + 1
				}
				if w <= 2 {
					k2 = 0
				} else {
					k2 = (w-1)/5 + 1
				}
				if k1 < k2 {
					k1 = k2
				}
				fee += tbl[k1]
			}
		}
		fmt.Println(fee)
	}
}

Python: while True:
    n= int(input())
    if n== 0: break
    ans= 0
    for _ in range(n):
        x, y, h, w= map(int, input().split())
        t= x+y+h
        if t<=60:
            s= "A" if w<=2 else("B" if w<=5 else("C" if w<=10 else("D" if w<= 15 else("E" if w<=20 else("F" if w<=25 else "G")))))
        elif t<=80:
            s= "B" if w<=5 else("C" if w<=10 else("D" if w<=15 else("E" if w<= 20 else("F" if w<=25 else "G"))))
        elif t<=100:
            s= "C" if w<=10 else("D" if w<=15 else("E" if w<=20 else("F" if w<= 25 else "G")))
        elif t<=120:
            s= "D" if w<=15 else("E" if w<=20 else("F" if w<=25 else "G"))
        elif t<=140:
            s= "E" if w<=20 else("F" if w<=25 else "G")
        elif t<=160 and w<=25:
            s= "F"
        else:
            s= "G"
        v= 600 if s=="A" else(800 if s=="B" else(1000 if s=="C" else(1200 if s=="D" else(1400 if s=="E" else(1600 if s=="F" else 0)))))
        ans+= v
    print(ans)

Python: import sys
import math
j=0
while j<20:
    n=int(input())
    if(n==0):
        break
    i=0
    a=0
    b=0
    c=0
    d=0
    e=0
    f=0
    while i<n:
        x,y,h,w=map(int,input().split())
        size=x+y+h
        if(size<=60 and w<=2):
            a=a+1
        elif(size<=80 and w<=5):
            b=b+1
        elif(size<=100 and w<=10):
            c=c+1
        elif(size<=120 and w<=15):
            d=d+1
        elif(size<=140 and w<=20):
            e=e+1
        elif(size<=160 and w<=25):
            f=f+1
        i=i+1
    total_money=(a*600)+(b*800)+(c*1000)+(d*1200)+(e*1400)+(f*1600)
    print(str(total_money))

Python: # Aizu Problem 00160: Delivery Fee
#
import sys, math, os, bisect

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


tariff = {'A': {"size":  60, "weight":  2, "price":  600},
          'B': {"size":  80, "weight":  5, "price":  800},
          'C': {"size": 100, "weight": 10, "price": 1000},
          'D': {"size": 120, "weight": 15, "price": 1200},
          'E': {"size": 140, "weight": 20, "price": 1400},
          'F': {"size": 160, "weight": 25, "price": 1600}}

def get_fee(s, w):
    for t in ['A', 'B', 'C', 'D', 'E', 'F']:
        if s <= tariff[t]["size"] and w <= tariff[t]["weight"]:
            return tariff[t]["price"]
    return 0

    
while True:
    n = int(input())
    if n == 0:
        break
    fee = 0
    for _ in range(n):
        x, y, z, w = [int(__) for __ in input().split()]
        s = x + y + z
        fee += get_fee(s, w)
    print(fee)

Python: def process(x, y, h, w):
    if x+y+h <= 60 and w <= 2:
        return 600
    elif x+y+h <= 80 and w <= 5:
        return 800
    elif x+y+h <= 100 and w <= 10:
        return 1000
    elif x+y+h <= 120 and w <= 15:
        return 1200
    elif x+y+h <= 140 and w <= 20:
        return 1400
    elif x+y+h <= 160 and w <= 25:
        return 1600
    else:
        return 0

result = []
while True:
    n = int(input())
    if n == 0: break
    total = 0
    for _ in range(n):
        x, y, h, w = map(int, input().split())
        total += process(x, y, h, w)
    result.append(total)
print('\n'.join(map(str, result)))

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


int sb[6]={60,80,100,120,140,160};
int wb[6]={2,5,10,15,20,25};

int main(){
	int n;
	while(cin>>n&&n){
		int s=0;
		for(int i=0;i<n;i++){
			int x,y,h,w;
			cin>>x>>y>>h>>w;
			int a,b;
			a=lower_bound(sb,sb+6,x+y+h)-sb;
			b=lower_bound(wb,wb+6,w)-wb;
			if(a==6||b==6)continue;
			s+=600+200*max(a,b);
		}
		cout<<s<<endl;
	}
	return 0;
}

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

int size[6] = {60, 80, 100, 120, 140, 160};
int weight[6] = {2, 5, 10, 15, 20, 25};
int fee[7] = {600, 800, 1000, 1200, 1400, 1600, 0};

int main() {
	int n;
	int x, y, h, w;
	int cost;
	
	while(cin >> n, n){
		cost = 0;
		
		for(int i = 0; i < n; ++i){
			cin >> x >> y >> h >> w;
			int k, l;
			
			for(k = 0; k < 6; ++k){
				if(x + y + h <= size[k]) break;
			}
			
			for(l = 0; l < 6; ++l){
				if(w <= weight[l]) break;
			}
			
			cost += fee[max(k, l)];
		}
		cout << cost << endl;
	}
	
	return 0;
}

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

int main() {
  int n, x, y, h, w, l, as, bs, s, cost;
  int a[6] = {60, 80, 100, 120, 140, 160};
  int b[6] = {2, 5, 10, 15, 20, 25};
  int c[6] = {600, 800, 1000, 1200, 1400, 1600};
  while (1) {
    cin >> n;
    if (!n) break;
    cost = 0;
    for (int i=0; i<n; i++) {
      cin >> x >> y >> h >> w;
      l = x + y + h;
      as = lower_bound(a, a+6, l) - a;
      bs = lower_bound(b, b+6, w) - b;
      s = max(as, bs);
      if (s < 6) {
        cost += c[s];
      }
    }
    cout << cost << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007;


int p[3][7]={{160,140,120,100,80,60,0},
			{25,20,15,10,5,2,0},
			{0,1600,1400,1200,1000,800,600}
		};

int main(){
	int n,x,y,h,w;
	int b;
	int ans;
	while(cin>>n &&n>0){
		ans=0;
		rep(i,n){
			cin>>x>>y>>h>>w;
			b=x+y+h;
			rep(j,7){
				if(b>p[0][j]||w>p[1][j]){
					ans+=p[2][j];
					break;
				}
			}
		}
		cout<<ans<<endl;
	}
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int n;

int main(){
	while(1){
		cin>>n;
		if(!n) break;
		int ans=0,x,y,h,w,S;
		for(int i=0;i<n;i++){
			cin>>x>>y>>h>>w;
			S=x+y+h;
			if(S<=60&&w<=2) ans+=6;
			else if(S<=80&&w<=5) ans+=8;
			else if(S<=100&&w<=10) ans+=10;
			else if(S<=120&&w<=15) ans+=12;
			else if(S<=140&&w<=20) ans+=14;
			else if(S<=160&&w<=25) ans+=16;
		}
		cout<<ans*100<<endl;
	}
}