Cod sursa(job #637549)

Utilizator Teodor94Teodor Plop Teodor94 Data 20 noiembrie 2011 15:09:08
Problema Minesweeper Scor 10
Compilator cpp Status done
Runda .com 2011 Marime 0.4 kb
#include<cstdio>

using namespace std;

const int N = 500;

int n, m;
double rez[N];

int main() {
    freopen("minesweeper.in", "r", stdin);
    freopen("minesweeper.out", "w", stdout);

    scanf("%d%d", &n, &m);
    n *= m;

    rez[1] = 2;
    rez[3] = 28.928571;
    rez[2] = rez[3] / 3;

    for (int i = 4; i <= 22 * 22; ++i)
        rez[i] = rez[i - 1] * 3;

    printf("%.6lf", rez[n]);

    return 0;
}