#include int main() { using namespace std; cin.tie(nullptr)->sync_with_stdio(false); int tt; cin >> tt; while (tt--) { int n, target; cin >> n >> target; [&] { for (int x = 0; x <= 100; ++x) for (int y = 0; y <= 100; ++y) if (2 * x + (n - 2) * y == target) { cout << "Yes\n"; for (int i = 1; i < n; ++i) for (int j = i + 1; j <= n; ++j) cout << i << ' ' << j << ' ' << (i == 1 ? x : y) << '\n'; return; } cout << "No\n"; }(); } }