#include #include #include using namespace std; int main() { int n, m; vector v; cin >> n >> m; while (n--) { long long a; cin >> a; v.push_back(a); } sort(v.begin(), v.end()); while (m--) { long long b; cin >> b; cout << upper_bound(v.begin(), v.end(), b) - lower_bound(v.begin(), v.end(), b) << " \n"[!m]; } return 0; }