#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
int n;
long double p[1005][1005], dis[1005], rest[1005];
bool vis[1005];
void work() {
  double x = 1e18;
  int id;
  for (register int i = (1); i <= (n); ++i)
    if (!vis[i] && (dis[i] + rest[i]) / (1 - rest[i]) <= x)
      x = (dis[i] + rest[i]) / (1 - rest[i]), id = i;
  vis[id] = 1;
  dis[id] = (dis[id] + rest[id]) / (1 - rest[id]);
  if (id == 1) {
    printf("%.15lf\n", (double)dis[1]);
    exit(0);
  }
  for (register int i = (1); i <= (n); ++i)
    if (!vis[i])
      dis[i] += rest[i] * p[i][id] * (dis[id] + 1), rest[i] *= (1 - p[i][id]);
}
signed main() {
  n = read();
  for (register int i = (1); i <= (n); ++i)
    for (register int j = (1); j <= (n); ++j) p[i][j] = 0.01 * read();
  for (register int i = (1); i <= (n - 1); ++i) rest[i] = 1;
  for (register int i = (1); i <= (n); ++i) work();
  return 0;
}
