#include #include #include using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(n); i++) int main(){ int num_people; cin >> num_people; int num_walls; cin >> num_walls; vector pos_people(num_people); for(int& a : pos_people) cin >> a; vector pos_walls(num_walls); for(int& a : pos_walls) cin >> a; sort(pos_walls.begin(), pos_walls.end()); for(int& x : pos_people){ auto first_hit = lower_bound(pos_walls.begin(), pos_walls.end(), x) - pos_walls.begin(); if(first_hit == pos_walls.size()){ cout << "Infinity\n"; } else{ auto pos_hit = pos_walls[first_hit]; int ans = pos_hit - x; cout << ans << "\n"; } } return 0; } struct ios_do_not_sync { ios_do_not_sync() { ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;