Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		buf := strings.Split(scanner.Text(), " ")
		a, _ := strconv.Atoi(buf[0])
		b, _ := strconv.Atoi(buf[1])
		c, _ := strconv.Atoi(buf[2])
		d, _ := strconv.Atoi(buf[3])
		e, _ := strconv.Atoi(buf[4])
		f, _ := strconv.Atoi(buf[5])
		if a == 0 && b == 0 && c == 0 && d == 0 && e == 0 && f == 0 {
			break
		}
		fmt.Println(100-((5*a+3*b)*2)-(f-5*a-3*b-e)*3+15*a+15*b+15*(5*a+3*b)+c*7+d*2)
	}
}

C++: #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
#include <complex>
using namespace std;

const int INF = 1<<29;
const double EPS = 1e-8;
typedef vector<int> vec;
typedef pair<int,int> P;
struct edge{int to,cost;};

int main(){

    while(1){
        int b,r,g,c,s,t;
        scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t);
        if(!b&&!r&&!g&&!c&&!s&&!t)break;
        cout << 100 + b*15 + b*5*13 + r*15 + r*3*13 + g*7 + c*2 - 3*(t - (b*5 + r*3 + s)) << endl;
    }

    return 0;
}

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

int main(){
    int b,r,g,c,s,t;
    while(cin >> b >> r >> g >> c >> s >> t, t != 0){
        int bonus = b*5 + r*3;
        int ans = 15*bonus +  15*b + 15*r + 7*g + 2*c + bonus + 3*s - 3*t + 100;
        cout << ans << endl;
    }
        
}

C++: #include<iostream>

using namespace std;

int main() {
	int b,r,g,c,s,t;
	int coin,bonus;
	bool star;
	
	
	while (cin >> b, cin >> r, cin >> g, cin >> c, cin >> s, cin >> t, b+r+g+c+s+t ) {
		coin = 100;
		bonus = 0;
		star = false;
		
		for ( int i = 0; i < t; i++ ) {
			if ( star == true ) {
				star = false;
			} else if ( bonus > 0 ) {
				coin = coin - 2;
			} else {
				coin = coin - 3;
			}
			if ( bonus > 0 ) {
				coin = coin + 15;
				bonus --;
			} else if ( s > 0 ) {
				star = true;
				s--;
			} else if ( c > 0 ) {
				coin = coin + 2;
				c--;
			} else if ( g > 0 ) {
				coin = coin + 7;
				g--;
			} else if ( r > 0 ) {
				bonus = 3;
				coin = coin + 15;
				r--;
			} else if ( b > 0 ) {
				bonus = 5;
				coin = coin + 15;
				b--;
			}
				
		}
		cout << coin << endl;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ULL;
template<class T> inline bool amax (T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool amin (T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> ostream& operator << (ostream &os, const vector<T> &v) { os << "["; for (typename vector<T>::const_iterator it = v.begin(); it != v.end(); it++) { os << (it != v.begin() ? ", " : "") << *it; } os << "]"; return os; }
template<class T> ostream& operator << (ostream &os, const set<T> &s) { os << "["; for (typename set<T>::const_iterator it = s.begin(); it != s.end(); it++) { os << (it != s.begin() ? ", " : "") << *it; } os << "]"; return os; }
template<class Key, class Val> ostream& operator << (ostream &os, const map<Key, Val> &m) { os << "{"; for (typename map<Key, Val>::const_iterator it = m.begin(); it != m.end(); it++) { os << (it != m.begin() ? ", " : "") << it->first << ":" << it->second; } os << "}"; return os; }
template<class T, class S> ostream& operator << (ostream &os, const pair<T, S> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template <class T> istream& operator >> (istream &is, vector<T> &v) { for (size_t i = 0; i < v.size(); i++) is >> v[i]; return is; }
template <class Target, class Source> inline Target lexical_cast (const Source &s) { Target t; stringstream ss; ss << s; ss >> t; return t; }

//> v < ^ (clock wise)
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
const int INFI = 1<<28;
const long long int INFL = 1LL<<60;
const double INFD = 1e+300;
const float INFF = 1e+100;
const double EPS = 1e-8;
const long long int MOD = 1000000007;

int solve ();
int main () {
    cout.setf(ios::fixed); cout.precision(10);
    ios_base::sync_with_stdio(false);
    solve();
    return 0;
}

int solve () {
    int b, r, g ,c, s, t;
    while(cin >> b >> r >> g >> c >> s >> t, b || r || g || c || s || t){
        cout << (b * 15 + r * 15 + -3 * t + (5 * b + 3 * r) + 3 * s + (5 * 15) * b + (3 * 15) * r + g * 7 + c * 2 + 100) << endl;
    }
    return 0;
}

C++: #include <cstdio>

int main(void)
{
	int b, r, g, c, s, t;
	
	while (scanf("%d %d %d %d %d %d", &b, &r, &g, &c, &s, &t)){
		if (b == 0 && r == 0 && g == 0 && c == 0 && s == 0 && t == 0){
			break;
		}
		int res = 100;
		int bonus = b * 5 + r * 3;
		
		res += (g * 7) + (c * 2) + (b * 15) + (r * 15);
//		printf("res >> %d\n", res);
		res -= bonus * 2;
//		printf("res >> %d\n", res);
		res += bonus * 15;
//		printf("res >> %d\n", res);
		res -= (t - bonus) * 3;
//		printf("res >> %d\n", res);
		res += s * 3;
		
		
		
		printf("%d\n", res);
	}
	
	return (0);
}

C++: #include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define ll2(x, y) ll x, y; cin >> x >> y;
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int b, r, g, c, s, t;
    scanf("%d%d%d%d%d%d", &b, &r, &g, &c, &s, &t);
    if(!(b | r | g | c | s | t))break;

    int res = 100;
    res += 5 * b * 16 + 3 * r * 16 + g * 7 + c * 2 + s * 3;
    res += b * 15 + r * 15;
    res -= t * 3;
    pri(res);

//*/

//*/ break;
  }
  return 0;
}

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

using namespace std;

int main()
{
	int medal = 100;
	int p[5];
	int t;

	while (1){
		int pro, loss;

		for (int i = 0; i < 5; i++){
			scanf("%d", &p[i]);
		}
		scanf("%d", &t);

		if (t == 0){
			break;
		}

		medal -= 3 * (t - (p[0] * 6 + p[1] * 4 + p[2] + p[3] + p[4]));
		medal += p[0] * 77 + p[1] * 51 + p[2] * 4 + p[3] * -1;

		cout << medal << endl;
	}

	return (0);
}

C++: #include <stdio.h>

int main(){
	const int p[6] = {
		77, 51, 
		4, -1, 0, -3
	};
	int n[6];
	while(1){
		for(int i=0;i<6;++i)
			scanf("%d",&n[i]);
		if( n[5] == 0 ) break;
		n[5] -= n[0] * 6 + n[1] * 4 + n[2] + n[3] + n[4];
		int sum = 100;
		for(int i=0;i<6;++i)
			sum += n[i] * p[i];
		printf("%d\n", sum);
	}
	return 0;
}