#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int v[N], n;
double d[N], te[N], a[N][N];
int main() {
  scanf("%d", &n);
  if (n == 1) return 0 * puts("0");
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      int x;
      scanf("%d", &x);
      a[i][j] = 0.01 * x;
    }
  for (int i = 1; i <= n; i++) d[i] = 1, te[i] = 1 - a[i][n];
  d[n] = 0;
  v[n] = 1;
  for (int i = 1; i <= n; i++) {
    int x = 0;
    double mn = 1e18;
    for (int j = 1; j <= n; j++)
      if (!v[j] && d[j] / (1 - te[j]) < mn) mn = d[j] / (1 - te[j]), x = j;
    if (x == 1) return printf("%.15lf", mn), 0;
    v[x] = 1;
    for (int j = 1; j <= n; j++) {
      d[j] += mn * a[j][x] * te[j], te[j] *= 1 - a[j][x];
    }
  }
  return 0;
}
