Cod sursa(job #637545)

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

using namespace std;

const int N = 500;

int n, m;
long 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[2] = rez[3] / 3;
    rez[3] = 28.928571;

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

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

    return 0;
}