#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int maxN = 1 << 10;
const long double INF = 1e30;
long double dist[maxN], p[maxN], P[maxN][maxN];
bool juz[maxN];
long double eval(int v) {
  if (p[v] > 0.99999) return INF;
  return (dist[v] + p[v]) / (1.0 - p[v]);
}
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = (1); i < (int)(n + 1); i++)
    for (int j = (1); j < (int)(n + 1); j++)
      scanf("%Lf", &P[i][j]), P[i][j] /= 100;
  fill(p, p + n, 1.0);
  dist[0] = INF * 10;
  for (int _ = (0); _ < (int)(n); _++) {
    int v = 0;
    for (int u = (1); u < (int)(n + 1); u++)
      if (!juz[u] and eval(u) < eval(v)) v = u;
    juz[v] = true;
    dist[v] = eval(v);
    for (int u = (1); u < (int)(n + 1); u++)
      if (!juz[u]) {
        dist[u] += (dist[v] + 1.0) * p[u] * P[u][v];
        p[u] *= 1.0 - P[u][v];
      }
    0;
  }
  printf("%.9Lf\n", dist[1]);
}
int main() {
  int t;
  t = 1;
  while (t--) solve();
}
