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