#include <bits/stdc++.h>
using namespace std;
template <typename tn>
void read(tn &a) {
  tn x = 0, f = 1;
  char c = ' ';
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  a = x * f;
}
const int N = 1010;
int n, vis[N];
double mp[N][N], f[N], g[N], p[N];
int main() {
  read(n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      int p;
      read(p);
      mp[i][j] = p / 100.;
    }
  for (int i = 1; i < n; i++) f[i] = 1e9, p[i] = 1;
  for (int t = 1; t <= n; t++) {
    int x = 0;
    for (int i = 1; i <= n; i++)
      if (!vis[i] && (!x || f[i] < f[x])) x = i;
    vis[x] = 1;
    for (int i = 1; i <= n; i++)
      if (!vis[i] &&
          (g[i] + p[i] * mp[i][x] * (f[x] + 1) + (p[i] * (1 - mp[i][x]))) /
                  (1 - p[i] * (1 - mp[i][x])) <
              f[i]) {
        f[i] = (g[i] + p[i] * mp[i][x] * (f[x] + 1) + (p[i] * (1 - mp[i][x]))) /
               (1 - p[i] * (1 - mp[i][x]));
        g[i] = (g[i] + p[i] * mp[i][x] * (f[x] + 1));
        p[i] = p[i] * (1 - mp[i][x]);
      }
  }
  cout << fixed << setprecision(10) << f[1] << '\n';
  return 0;
}
