// Problem: D - Small Multiple // Contest: AtCoder - AtCoder Regular Contest 084 // URL: https://atcoder.jp/contests/arc084/tasks/arc084_b // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h> usingnamespace std; #define int long long inlineintread(){int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+ (x<<3)+(ch^48);ch=getchar();}return x*f;} //#define M //#define mo #define N 100010 structNode { int x, y; booloperator <(const Node &A) const { return x>A.x; } }t; structnode { int x, y, z, n; }d[N*10]; int n, m, i, j, k; int u, v, g; int ans[N], h[N], b[N]; priority_queue<Node>q;