#include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; string yn(bool f){return f?"Yes":"No";} string YN(bool f){return f?"YES":"NO";} signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout< A, B, a, b; string op; int con = 0, sum = 0; cin>>N>>M>>K; cin>>op; B.resize(M); A.resize(N); for(int i = 0; i < M; i++){ cin>>B[i]; } for(int i = 0; i < N; i++){ cin>>A[i]; sum += A[i]; } a = A; b = B; sort(a.begin(), a.end()); if(op == "+") { for(int i = 0; i < M; i++){ // con += N - (lower_bound(a.begin(), a.end(), x) - a.begin()); con += B[i] * N + sum; con %= K; // cout<