#include<cstdio>#include<cctype>#include<cstdlib>#include<cstring>char str[1000];double num(char *str, int i, char unit){int j;double prefixes = 1.0;for (j = i; str[j] != unit; j++);if (isalpha(str[j - 1])){if (str[j - 1] == 'm')prefixes = 0.001;else if (str[j - 1] == 'k')prefixes = 1000.0;elseprefixes = 1000000.0;}return atof(str + i + 1) * prefixes;}int main(void){double U, I, P;int n, i, count = 0;scanf("%dn", &n);while (n--){U = I = P = -1.0;gets(str);int l = strlen(str);for (i = 0; str[i] != '='; i++);if (str[i - 1] == 'U')U = num(str, i, 'V');else if (str[i - 1] == 'P')P = num(str, i, 'W');elseI = num(str, i, 'A');for (i = l - 1; str[i] != '='; i--);if (str[i - 1] == 'U')U = num(str, i, 'V');else if (str[i - 1] == 'P')P = num(str, i, 'W');elseI = num(str, i, 'A');printf("Problem #%dn", ++count);if (U == -1.0)printf("U=%.2fVnn", P / I);else if (P == -1.0)printf("P=%.2fWnn", U * I);elseprintf("I=%.2fAnn", P / U);}return 0;}


