#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, vis[N];
double p[N][N], A[N], B[N];
double dis(int u) { return B[u] < 1 ? A[u] / (1 - B[u]) : 1e9; }
int main() {
  cin >> n;
  for (int i = (1); i <= (n); i++)
    for (int j = (1); j <= (n); j++) scanf("%lf", &p[i][j]), p[i][j] /= 100;
  for (int i = (0); i <= (n); i++) A[i] = 1, B[i] = 1;
  A[n] = B[n] = 0;
  for (int i = (1); i <= (n); i++) {
    int u = 0;
    for (int j = (1); j <= (n); j++)
      if (!vis[j] && dis(j) < dis(u)) u = j;
    vis[u] = 1;
    for (int j = (1); j <= (n); j++)
      if (!vis[j]) A[j] += p[j][u] * dis(u) * B[j], B[j] *= 1 - p[j][u];
  }
  printf("%.15lf\n", dis(1));
  return 0;
}
