#include<bits/stdc++.h>
using namespace std;
void solve() {
int t;
scanf("%d", &t);
long int n, m, k, i = 1;
while(t--) {
scanf("%ld %ld %ld", &n, &m, &k);
long int nres = 0;
nres = (n - 1) + n * (m - 1) + n * m * (k - 1);
int kres = 0;
kres = ceil(log(n) / log(2)) + ceil(log(m) / log(2)) + ceil(log(k) / log(2));
printf("Case #%ld: %ld %d\n", i, nres, kres);
i++;
}
}
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
solve();
return 0;
}
I have tried various test cases and also the boundary cases but not able to solve the problem.
Is there any other tricky case?