import std.stdio, std.string, std.conv; import std.range, std.algorithm, std.array, std.typecons, std.container; import std.math, std.numeric, core.bitop; enum inf = 1<<30; void main() { int n; scan(n); auto a = new int[](n); auto b = new int[](n); foreach (i ; 0 .. n) { scan(a[i], b[i]); } auto dp = new int[][](1<