#pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include int ri() { int n; scanf("%d", &n); return n; } int main() { int n = ri(); long double ans = 0; for (int i = 0; i < n; i++) { long double x, a; scanf("%Lf%Lf", &x, &a); long double res = sin(x) / x; for (int j = 1; j <= 20000; j++) res += sin(x + j) / (x + j) + sin(x - j) / (x - j); ans += res * a; } printf("%.12Lf\n", ans); return 0; }