#ifdef MAIN bool __multi__ = 0; using INT = long long; namespace XK { void solve() { ll N, M; double P; rd(N, M, P); if(N == 1 && M == 1) { wt(P); } else if(N == 1 || M == 1) { if(N > M) swap(N, M); double ans = 0.0f; ans += 2 * P * P + (M - 2) * P * P * P; wt(ans); } else { double ans = 0.0f; ans += 4 * P * P * P; ans += (2 * (N - 2) + 2 * (M - 2)) * P * P * P * P; ans += (N - 2) * (M - 2) * P * P * P * P * P; wt(ans); } } }; #else #include "cassert" #include "cmath" #include "cstdint" #include "cstdio" #include "cstdlib" #include "cstring" #include "algorithm" #include "bitset" #include "chrono" #include "complex" #include "deque" #include "functional" #include "iostream" #include "limits" #include "map" #include "numeric" #include "queue" #include "random" #include "set" #include "sstream" #include "string" #include "unordered_map" #include "unordered_set" #include "utility" #include "vector" #include "array" using namespace std; #define int long long using ll = long long; using ull = unsigned long long; const ll INF = 1ll << 60; const ll LINF = 0x1fffffffffffffff; const ll MINF = 0x7fffffffffff; template bool chmax(A& l, const B& r){ return r > l ? l = r, 1 : 0; } template bool chmin(A& l, const B& r){ return r < l ? l = r, 1 : 0; } #define sz(x) ssize(x) #define rep(i, a) for(ll i = 0; i < (a); i ++) #define Rep(i, a, b) for(ll i = (a); i < (b); i ++) #define rrep(i, a, b) for(ll i = (b); i --> (a); ) #define all(x) begin(x), end(x) template void rd(Ts&... t); [[maybe_unused]] void wtN(){} template void wtN(const T& t, const Ts&... ts); template void wt(const Ts&... ts){ wtN(ts...); cout << '\n'; } namespace IO{ #define VOID(a) decltype(void(a)) struct S{ S(){ cin.tie(nullptr)->sync_with_stdio(0); fixed(cout).precision(12); } }S; template struct P : P{}; template<> struct P<0>{}; template void i(T& t){ i(t, P<3>{}); } void i(vector::reference t, P<3>){ int a; i(a); t = a; } template auto i(T& t, P<2>) -> VOID(cin >> t){ cin >> t; } template auto i(T& t, P<1>) -> VOID(begin(t)){ for(auto&& x : t) i(x); } template void ituple(T& t, index_sequence){ in(get(t)...); } template auto i(T& t, P<0>) -> VOID(tuple_size{}){ ituple(t, make_index_sequence::value>{}); } template void o(const T& t){ o(t, P<4>{}); } template void o(const char (&t)[N], P<4>){ cout << t; } template void o(const T (&t)[N], P<3>){ o(t[0]); for(size_t i = 1; i < N; i++){ o(' '); o(t[i]); } } template auto o(const T& t, P<2>) -> VOID(cout << t){ cout << t; } template auto o(const T& t, P<1>) -> VOID(begin(t)){ bool first = 1; for(auto&& x : t) { if(first) first = 0; else o(' '); o(x); } } template void otuple(const T& t, index_sequence){ wtN(get(t)...); } template auto o(T& t, P<0>) -> VOID(tuple_size{}){ otuple(t, make_index_sequence::value>{}); } #undef VOID } template void rd(Ts&... t){ (IO::i(t), ...); } template void wtN(const T& t, const Ts&... ts){ IO::o(t); (IO::o((cout << ' ', ts)), ...); } #undef unpack constexpr ll debug_const(ll judge, ll debug) { #ifdef DEBUG return debug; #else return judge; #endif } #ifdef DEBUG ll __lg(ull x){ return 63 - __builtin_clzll(x); } #define debug(...) { wtN(#__VA_ARGS__); wtN(":"); wt(__VA_ARGS__); } #else #define debug(...) void(0) #endif #define fst first #define snd second #define pb push_back template using V = vector; template using AR = array; #define MAIN #include __FILE__ signed main() {int t = 1;if(__multi__) cin >> t;while(t --) XK::solve();} #endif