1.

/**
* ACM Training 2009
* ACM Problem #11346 - Probability
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=25&page=show_problem&problem=2321
*
* @author Felix Dietrich
* @version 1.0, 12/03/2009
*
* Methode:
* Status : Accepted
* Runtime: 0.212
*/

import java.util.Scanner;

class Main
{
public static void main(String... s)
{
Scanner sc = new Scanner(System.in);
int testcases = sc.nextInt();
double a, b, S;
double x0;

for (int i = 0; i < testcases; i++)
{
a = sc.nextDouble();
b = sc.nextDouble();
S = sc.nextDouble();

x0 = S/b;

if (a*b <= S)
System.out.println(String.format("%.06f", 0.0) + "%");
else if (Math.abs(S) < 1e-6)
System.out.println(String.format("%.06f", 100.0) + "%");
else
System.out.println(String.format("%.06f", 100*(a*b-x0*b-S*Math.log(a/x0)) / (a*b)) + "%");
}
}
}


2.

/**
* ACM Training, WS09/10
* ACM Problem #11346 Probability
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=25&page=show_problem&problem=2321
*
* @author Doina Logofatu
* @version 1.0, 12/03/2009
*
* Methode: Math, Probability
* Status : Accepted
* Runtime: 0.008
*/

#include <stdio.h>
#include <math.h>

int main(){

int n;
double a, b, S;
double x0, P;

scanf("%d", &n);

while(n--){
scanf("%lf%lf%lf", &a, &b, &S);
x0 = S/b;

if(a*b<=S) P = 0;
else
if(S>0) P = ((a-x0)*b-S*log(a/x0))/(a*b)*100;
else P=100.;
printf("%.6lf%%\n", P);
}
return 0;

}