typedef pair<int, int> PII;
struct pair_hash
{
template<class T1, class T2>
size_t operator() (const pair<T1, T2>& p) const
{
auto h1 = hash<T1> {}(p.first);
auto h2 = hash<T2> {}(p.second);
return h1 ^ h2;
}
};
unordered_map<PII, int, pair_hash> hs;