import java.util.Random;

public class Main {

	public static void main(String[] args) {
		final Random random = new Random();
		double t = 0;
		double t1 = 6953;
		int cnt = 0;
		int cnt2 = 0;
		System.out.println("New temp: " + (int) t1);
		System.out.println("Real \tIndicate \tDelta");
		while (cnt2 < 11) {
			cnt++;
			t = (t + t1) / 2;
			System.out.print((int) t1 + "\t");
			System.out.printf("%.3f \t", t);
			System.out.printf("%.3f", (t1 - t));
			System.out.println();
			if (Math.abs(t1 - t) < 0.01) {
				System.out.println("Delta<0.01, total cicles:" + cnt);
				cnt = 0;
				if (cnt2 == 10)
					break;
				t1 = random.nextInt(10000);
				System.out.println();
				System.out.println("New temp: " + (int) t1);
				System.out.println("Real \tIndicate \tDelta");
				cnt2++;
			}
		}

	}

}
