Saturday, July 12, 2014

UVa - 12502 - Three Families

#include <iostream>
using namespace std;

int main(){
    int x, y, z, t, ans;
    cin >> t;
    while(t--){
        cin >> x >> y >> z;
        ans = z * (2*x - y) / (x + y);
        cout << ans << endl;
    }

    return 0;
}

No comments:

Post a Comment