import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { static class Good { int v; int p; int q; int sub1; int sub2; public Good() { } public Good(int v, int p, int q) { this.v = v; ...