All pastes #330960 Raw Edit

Unnamed

public cpp v1 · immutable
#330960 ·published 2007-01-28 12:47 UTC
rendered paste body
#include <iostream>using namespace std;int main(){        int _T; scanf("%d", &_T);        while(_T--) {                int W, B, C; scanf("%d %d %d", &W, &B, &C);                if(C == 1) {                        printf("%.3llf\n", ((long double)W)/(W+B));                } else if(W == 0) {                        printf("0.000\n");                } else {                        if(W < C) {                                printf("%.3llf\n", ((long double)W)/C);                        } else {                                long double first = ((long double)(C-1))/C;                                long double second = ((long double)(W-C+1));                                long double third = ((W-C+1+B)*C);                                printf("%.3llf\n", first+second/third);                        }                }        }        return 0;}