#include <iostream>
#include <iomanip>
#define SIZE 3
using namespace std;
int main()
{
float arr[SIZE][SIZE] = { { 6, 1, 1 },{ 4, -2, 5 },{ 2, 8, 7 } };
/*
* a b c
* arr = d e f
* g h i
*
* determinant = a*(e*i - f*h) - b*(d*i-f*g) + c*(d*h - e*g)
*
*/
float determinant = arr[0][0] * (arr[1][1] * arr[2][2] - arr[1][2] * arr[2][1]) -
arr[0][1] * (arr[1][0] * arr[2][2] - arr[1][2] * arr[2][0]) +
arr[0][2] * (arr[1][0] * arr[2][1] - arr[1][1] * arr[2][0]);
cout << fixed << setprecision(2) << determinant << endl;
return 0;
}
/*
run:
-306.00
*/