import java.math.BigDecimal; import java.math.RoundingMode; import java.util.Scanner; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0; i < n; i++) { int a = sc.nextInt(); int b = sc.nextInt(); solve(a, b); } sc.close(); } public static void solve (int a, int b) { double d = Math.log10(a) * b; long n = (long)d; double m = d - n; BigDecimal d2 = BigDecimal.valueOf(Math.pow(10, m)).setScale(1, RoundingMode.DOWN); String[] out = (d2 + "").split("\\."); System.out.println(out[0] + " " + out[1] + " " + n); } }