ABC142A - Odds of Oddness
#include <iomanip> #include <iostream> using namespace std; int main(void) { int n; cin.tie(0); ios::sync_with_stdio(false); cin >> n; cout << fixed << setprecision(10) << (n % 2 == 0? n / 2 / (double) n : (n + 1) / 2 / (double) n) << "\n"; return 0; }