#include <bits/stdc++.h>
using namespace std;
const int Max_N(1050);
int N;
double P[Max_N][Max_N], F[Max_N], G[Max_N], V[Max_N];
bool done[Max_N];
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) {
    V[i] = 1.0;
    for (int j = 1; j <= N; ++j) scanf("%lf", P[i] + j), P[i][j] /= 100.0;
    if (i < N) F[i] = 1E100;
  }
  for (int u;;) {
    u = -1;
    for (int x = 1; x <= N; ++x)
      if (!done[x] && (u == -1 || F[x] < F[u])) u = x;
    if (u == -1) break;
    done[u] = true;
    for (int v = 1; v <= N; ++v)
      if (!done[v] && P[v][u] != 0.0)
        G[v] += V[v] * P[v][u] * F[u], V[v] *= (1.0 - P[v][u]),
            F[v] = 1.0 / (1.0 - V[v]) + G[v] / (1.0 - V[v]);
  }
  printf("%.10lf", F[1]);
  return 0;
}
