#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n;
bool fix[N];
double p[N][N], e[N], X[N], Y[N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout << setprecision(6) << fixed;
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      int x;
      cin >> x;
      p[i][j] = x / 100.;
    }
  fill(e, e + N, 1e12);
  fill(Y, Y + N, 1.);
  fill(X, X + N, 0.);
  e[n - 1] = 0., fix[n - 1] = true, X[n - 1] = 0., Y[n - 1] = 0.;
  int v = n - 1;
  bool fnd = true;
  while (fnd) {
    fnd = false;
    for (int i = 0; i < n; i++)
      if (!fix[i]) {
        X[i] += Y[i] * p[i][v] * (e[v] + 1.);
        Y[i] *= 1. - p[i][v];
        e[i] = (X[i] + Y[i]) / (1. - Y[i]);
      }
    double mn = 1e9;
    for (int i = 0; i < n; i++)
      if (!fix[i] && e[i] < mn) mn = e[i], v = i, fnd = true;
    fix[v] = true;
  }
  cout << e[0] << '\n';
  return 0;
}
