#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T x) {
  return x * x;
}
const int maxn = 1003;
int p[maxn][maxn];
double sum[maxn], pr[maxn];
bool used[maxn];
double getans(double x, double y) { return (x + y) / (1 - y); }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> p[i][j];
  for (int i = 1; i <= n; i++) {
    sum[i] = 0;
    pr[i] = 1;
  }
  pr[n] = 0;
  for (int k = 1; k <= n; k++) {
    int num = -1;
    for (int i = 1; i <= n; i++)
      if (!used[i]) {
        if (pr[i] != 1) {
          if (num == -1 || getans(sum[num], pr[num]) > getans(sum[i], pr[i])) {
            num = i;
          }
        }
      }
    used[num] = true;
    for (int i = 1; i <= n; i++)
      if (!used[i] && p[i][num] != 0) {
        sum[i] += pr[i] * (p[i][num] / 100.) * (1 + getans(sum[num], pr[num]));
        pr[i] *= 1 - p[i][num] / 100.;
      }
  }
  cout.precision(10);
  cout << fixed << getans(sum[1], pr[1]) << "\n";
  return 0;
}
