#include <bits/stdc++.h>
using namespace std;
char buf[1000000], *P1, *P2;
int n;
double dp[1005], nw[1005], a[1005][1005];
bool vs[1005];
int rd() {
  int res = 0;
  char c = 0;
  while (!isdigit(c))
    c = (P1 == P2 && (P2 = (P1 = buf) + fread(buf, 1, 1000000, stdin), P1 == P2)
             ? EOF
             : *P1++);
  while (isdigit(c))
    res = res * 10 + c - 48,
    c = (P1 == P2 && (P2 = (P1 = buf) + fread(buf, 1, 1000000, stdin), P1 == P2)
             ? EOF
             : *P1++);
  return res;
}
double calc(int u) { return (dp[u] + nw[u]) / (1 - nw[u]); }
void release(int u) {
  vs[u] = 1;
  for (int i = 1; i <= n; ++i)
    if (!vs[i]) dp[i] += (calc(u) + 1) * a[i][u] * nw[i], nw[i] *= 1 - a[i][u];
}
int main() {
  n = rd();
  for (int i = 1; i < n; ++i) nw[i] = 1;
  for (int i = 1, x; i <= n; ++i)
    for (int j = 1; j <= n; ++j) x = rd(), a[i][j] = 0.01 * x;
  release(n);
  for (int i = 1, t = 0; i < n; ++i, t = 0) {
    for (int j = 1; j <= n; ++j)
      if (!vs[j] && (!t || calc(j) < calc(t))) t = j;
    if (t == 1) break;
    release(t);
  }
  printf("%.10lf\n", calc(1));
  return 0;
}
