#include <bits/stdc++.h>   using namespace std;   template <typename T1, typename T2>   ostream& operator<<(std::ostream& os, const std::map<T1, T2>& v) {     os <<  [ ;     for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end();          ++ii)       os << ii->first <<  :  << ii->second <<    ;     return os <<  ] ;   }   template <class Cntnr>   ostream& c_out(std::ostream& os, const Cntnr& v) {     os <<  [ ;     for (typename Cntnr::const_iterator ii = v.begin(); ii != v.end(); ++ii)       os << *ii <<    ;     os <<   ] ;     return os;   }   template <typename T>   ostream& operator<<(ostream& o, const vector<T>& c) {     return c_out(o, c);   }   template <typename T>   ostream& operator<<(ostream& o, const list<T>& c) {     return c_out(o, c);   }   template <typename T>   ostream& operator<<(ostream& o, const set<T>& c) {     return c_out(o, c);   }   int main() {     int n, a, b;     scanf( %d , &n);     scanf( %d , &a);     scanf( %d , &b);     for (int i = (0); i < (int)(n); i++) {       long long w;       cin >> w;       cout << w - ((((w * a) / b) * b + a - 1) / a) <<    ;     }     return 0;   }   