#include <bits/stdc.h>
using namespace std;
int n,l,ans0,sna0,a;
int main(){cin >> l >> n;for(int i1;i<n;i){cin >> a;ansmax(min(l1-a,a),ans);snamax(max(l1-a,a),sna);}cout << ans << " "<< sna;
}
The biggest problem is determining the type of first input of each line.
Solu:
Character.isAlphebet( ) // true for letter
Character.isDigit( ) // true for digit
After the judge, choose to input the next 2 or 1 integer.