import java.io.IOException; import java.util.*; /** * Created by humac on 2017/9/7. */ public class Main { public static void main(String args[]) throws IOException { Scanner sc=new Scanner(System.in); while (sc.hasNext()){ String s=sc.nextLine(); int n=Integer.valueOf( s.split(" ")[0]);...