#include <iostream> using namespace std; int main() { int n, b; cin >> n; if (n <= 0 || n > 1000) { cerr << "Invalid input size." << endl; return 1; } int* a = new int[n]; int c[1000] = {0}; for (int i = 0; i &...