Created
October 4, 2018 22:52
-
-
Save cbdavide/7009118b83f005fa7e1b3d95572910a1 to your computer and use it in GitHub Desktop.
UVA 10491 - Cows and Cars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
int v, c, o, n; | |
while(scanf("%d %d %d\n", &v, &c, &o) == 3) { | |
n = c + v; | |
double answ = (c * (c - 1)) / (n * (n - o - 1) * 1.0); | |
answ += (c * v * 1.0) / (n * (n - o - 1)); | |
printf("%.5f\n", answ); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment