#include <stdio.h> typedef struct { int index; int val; } test; int main() { int n; while (scanf("%d", &n) != EOF) { int i, j;  ...