#include <bits/stdc++.h>
const int N = 2005;
double p[N][N], dis[N], pre[N];
int n, vis[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      scanf("%lf", &p[i][j]), p[i][j] = p[i][j] / 100;
  if (n == 1) {
    puts("0");
    return 0;
  }
  for (int i = 1; i < n; i++) dis[i] = 1, pre[i] = 1 - p[i][n];
  vis[n] = 1;
  for (int i = 1; i < n; i++) {
    double Min = 1000000000;
    int u = 0;
    for (int j = 1; j <= n; j++) {
      if (vis[j]) continue;
      if (dis[j] / (1 - pre[j]) < Min) Min = dis[j] / (1 - pre[j]), u = j;
    }
    if (u == 1) {
      printf("%.7lf", Min);
      return 0;
    }
    vis[u] = 1;
    for (int j = 1; j <= n; j++)
      if (!vis[j])
        dis[j] = dis[j] + Min * pre[j] * p[j][u],
        pre[j] = pre[j] * (1 - p[j][u]);
  }
  return 0;
}
