git reimport

This commit is contained in:
2019-03-15 13:47:54 +04:00
commit 3b461f73de
489 changed files with 1631603 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
package chelper;
import io.InputReader;
import io.OutputWriter;
import misc.SimpleSavingChelperSolution;
public class TaskA extends SimpleSavingChelperSolution {
public void solve(int testNumber, InputReader in, OutputWriter out) {
wrapSolve(testNumber, in, out);
}
@Override
public void solve(int testNumber) {
int testCount = in.nextInt();
for (int test = 0; test < testCount; test++) {
int a = in.nextInt();
int b = in.nextInt();
int n = in.nextInt();
while (true) {
int m = (a + b + 1) / 2;
out.println(m);
out.flush();
String resp = in.nextString();
if (resp.equals("CORRECT")) {
break;
} else if (resp.equals("TOO_BIG")) {
b = m - 1;
} else if (resp.equals("TOO_SMALL")) {
a = m + 1;
} else {
System.out.println("WTF");
}
}
}
}
}