//George Kuzler and Mark Ignacio
//9/30/2011
//squirt.c

#include <stdio.h>
#include <math.h>

int main() {

    //Create the file pointer and read in the number of cases.
    FILE* ifp = fopen("squirt.in", "r");

    int cases;
    fscanf(ifp, "%d", &cases);

    //Continue reading in cases until there are none left.
    int i, j;
    double num, thresh;
    for (i=0; i < cases; i++) {
        fscanf(ifp, "%lf%lf", &num, &thresh);

        //Take the square root of each number until it is below the threshold.
        for (j=0; num >= thresh; j++) {
            num = sqrt(num);
        }
        printf("Test case #%d: Squirt pressed the SQRT button %d times.\n", i+1, j);
    }

    fclose(ifp);

    return 0;
}
