{ команда МГТУ; задача #6 } var n,j,h,p,w,i,error,tasknum:integer; cur,power,volt,tempnum:real; st,temp,temp2,qual,result:string; f:text; begin assign(f,'ai.in'); reset(f); readln(f,n); tasknum:=0; for j:=1 to n do begin readln(f,st); inc(tasknum); power:=0; cur:=0; volt:=0; i:=1; while i<=length(st) do begin if st[i]='=' then begin temp2:=st[i-1]; inc(i); temp:=''; { delete(st,1,i);} while st[i] in ['0'..'9', '.'] do begin temp:=temp+st[i]; inc(i); end; val(temp,tempnum,error); qual:=st[i]+st[i+1]; case qual[1] of 'm': tempnum:=tempnum/1000; 'k': tempnum:=tempnum*1000; 'M': tempnum:=tempnum*1000000; end; {case} if temp2='P' then power:=tempnum; if temp2='U' then volt:=tempnum; if temp2='I' then cur:=tempnum; end; inc(i); end; result:=''; writeln('Задача #', tasknum); {writeln((234.1E-4):0:2);} if volt=0 then writeln('U=',power/cur:0:2 ,'V'); if power=0 then writeln('P=',cur*volt:0:2,'W'); if cur=0 then writeln('I=',power/volt:0:2,'A'); writeln; end; close(f); end.