[{"data":1,"prerenderedAt":10936},["ShallowReactive",2],{"nav:algorithms":3,"lesson:\u002Falgorithms\u002Fdynamic-programming\u002Fprinciples":374,"course-wordcounts":10804,"ref-card-index":10860},[4,28,50,71,120,152,205,230,286,306,331,352],{"module":5,"moduleNumber":6,"slug":7,"lessons":8},"Foundations",1,"foundations",[9,15,21],{"title":10,"path":11,"lessonNumber":6,"topics":12,"summary":14},"What Is an Algorithm?","\u002Falgorithms\u002Ffoundations\u002Fwhat-is-an-algorithm",[5,13],"Correctness & Induction","An algorithm is a finite, mechanical recipe that transforms inputs into outputs. We pin down what counts as an algorithm, how we write one down, and the three things we always ask of it: is it correct, is it fast, and can we prove it.\n",{"title":16,"path":17,"lessonNumber":18,"topics":19,"summary":20},"Asymptotic Analysis","\u002Falgorithms\u002Ffoundations\u002Fasymptotic-analysis",2,[16],"We measure an algorithm's running time as a function of its input size, then strip away machine-specific constants and lower-order terms to compare algorithms cleanly. This lesson defines the RAM model and the $O$, $\\Omega$, $\\Theta$, $o$, and $\\omega$ notations, and shows how to read the cost of loops off the page.\n",{"title":22,"path":23,"lessonNumber":24,"topics":25,"summary":27},"Recurrences and the Master Theorem","\u002Falgorithms\u002Ffoundations\u002Frecurrences",3,[26],"Recurrences","Recursive and divide-and-conquer algorithms describe their own running time with a recurrence: $T(n)$ in terms of $T$ on smaller inputs. We solve recurrences three ways — drawing the recursion tree, guessing-and-verifying by induction, and applying the Master Theorem — using merge sort as the running example.\n",{"module":29,"moduleNumber":18,"slug":30,"lessons":31},"Divide & Conquer","divide-and-conquer",[32,38,44],{"title":33,"path":34,"lessonNumber":6,"topics":35,"summary":37},"Divide and Conquer & Mergesort","\u002Falgorithms\u002Fdivide-and-conquer\u002Fmergesort",[29,36],"Comparison Sorting","Divide and conquer breaks a problem into smaller copies of itself, solves them recursively, and stitches the answers together. We meet the paradigm through mergesort — its merge step, its loop-invariant proof, and the recursion tree that pins its cost at $\\Theta(n\\log n)$ — then glimpse Karatsuba multiplication as a second example of the same idea.",{"title":39,"path":40,"lessonNumber":18,"topics":41,"summary":43},"Quicksort","\u002Falgorithms\u002Fdivide-and-conquer\u002Fquicksort",[36,42],"Probabilistic Analysis","Quicksort sorts in place by partitioning around a pivot and recursing on each side. We give Lomuto and Hoare partitioning with a correctness invariant, see why a bad pivot costs $\\Theta(n^2)$ while a balanced one gives $\\Theta(n\\log n)$, and prove that randomizing the pivot makes the expected cost $\\Theta(n\\log n)$ on every input.",{"title":45,"path":46,"lessonNumber":24,"topics":47,"summary":49},"Linear-Time Selection","\u002Falgorithms\u002Fdivide-and-conquer\u002Fselection",[48,29],"Order Statistics","Finding the $k$-th smallest element looks like it should require sorting, but it does not. Quickselect adapts quicksort's partition to recurse on just one side, achieving expected $O(n)$. The median-of-medians algorithm guarantees a good pivot with the groups-of-five trick, pushing the worst case down to a provable $O(n)$.",{"module":51,"moduleNumber":24,"slug":52,"lessons":53},"Sorting & Order Statistics","sorting",[54,60,65],{"title":55,"path":56,"lessonNumber":6,"topics":57,"summary":59},"Heaps and Heapsort","\u002Falgorithms\u002Fsorting\u002Fheaps-and-heapsort",[58,36],"Heaps","A binary heap is a tree we store flat in an array, with index arithmetic standing in for pointers. We build the max-heap property bottom-up in $O(n)$ time, sort in place in $\\Theta(n\\log n)$ by repeatedly extracting the maximum, and reuse the same structure to implement a priority queue.",{"title":61,"path":62,"lessonNumber":18,"topics":63,"summary":64},"Lower Bounds for Comparison Sorting","\u002Falgorithms\u002Fsorting\u002Fsorting-lower-bounds",[36],"Every sort we have seen runs in $\\Omega(n\\log n)$, and that is no accident. Modeling a sort as a decision tree of comparisons, we show any such tree must have $n!$ leaves, forcing height $\\ge \\log_2(n!) = \\Omega(n\\log n)$ — a worst-case bound no comparison sort can ever beat.",{"title":66,"path":67,"lessonNumber":24,"topics":68,"summary":70},"Sorting in Linear Time","\u002Falgorithms\u002Fsorting\u002Flinear-time-sorting",[69],"Linear-Time Sorting","The $\\Omega(n\\log n)$ barrier only binds algorithms that compare. By instead using keys as array indices we slip past it: counting sort runs in $\\Theta(n+k)$ and is stable, radix sort layers it digit by digit, and bucket sort averages $\\Theta(n)$ on uniform data. We see exactly when each applies.",{"module":72,"moduleNumber":73,"slug":74,"lessons":75},"Data Structures",4,"data-structures",[76,82,88,93,99,105,113],{"title":77,"path":78,"lessonNumber":6,"topics":79,"summary":81},"Elementary Data Structures","\u002Falgorithms\u002Fdata-structures\u002Felementary-structures",[80],"Linear Structures","Every container is built one of two ways: **contiguous** in an array, or **linked** through pointers. We trade cache-friendly random access against $O(1)$ splicing, derive the **amortized $O(1)$** append of a doubling dynamic array, and assemble the two ordered access disciplines — the LIFO **stack** and the FIFO **queue** (with its generalization, the **deque**) — on top of both.",{"title":83,"path":84,"lessonNumber":18,"topics":85,"summary":87},"Hash Tables","\u002Falgorithms\u002Fdata-structures\u002Fhash-tables",[86],"Hashing","A hash table implements the dictionary — insert, search, delete — in expected $O(1)$ time by scattering keys across an array with a hash function. We build up from direct addressing, handle collisions by chaining and by open addressing, analyze the load factor $\\alpha$, and see how universal hashing earns its expected-time guarantee against every input.",{"title":89,"path":90,"lessonNumber":24,"topics":91,"summary":92},"Binary Search Trees","\u002Falgorithms\u002Fdata-structures\u002Fbinary-search-trees",[89],"A binary search tree keeps keys ordered so that every operation follows a single root-to-leaf path. We state the BST property, give search and insert, find minimum, maximum, and successor, see that an inorder walk emits the keys in sorted order, and confront the catch — every operation costs $O(h)$, and a carelessly built tree degrades to height $h = \\Theta(n)$, motivating balance.",{"title":94,"path":95,"lessonNumber":73,"topics":96,"summary":98},"AVL Trees","\u002Falgorithms\u002Fdata-structures\u002Favl-trees",[97],"Balanced Trees","An AVL tree is the first balanced BST: at every node the two subtrees' heights differ by at most $1$. A Fibonacci-style minimal-node argument forces height $h \\le 1.44\\log_2 n = O(\\log n)$, so search, insert, and delete are all $O(\\log n)$. Insertion rebalances with at most one of four rotation cases (LL, RR, LR, RL); deletion may rotate all the way to the root.",{"title":100,"path":101,"lessonNumber":102,"topics":103,"summary":104},"Balanced Search Trees","\u002Falgorithms\u002Fdata-structures\u002Fbalanced-trees",5,[97],"An ordinary BST can degrade to height $\\Theta(n)$; balanced search trees guarantee $h = O(\\log n)$ by maintaining invariants and repairing them after every update. We meet rotations, the local restructuring primitive, then red-black trees, whose color invariants force logarithmic height, and finally B-trees, which trade tall-and-thin for short-and-wide to win on disk.",{"title":106,"path":107,"lessonNumber":108,"topics":109,"summary":112},"Disjoint Sets (Union-Find)","\u002Falgorithms\u002Fdata-structures\u002Funion-find",6,[110,111],"Disjoint Sets","Amortized Analysis","The disjoint-set data structure tracks a partition of elements into groups, answering \"are these two in the same group?\" and merging groups on demand. A forest of parent pointers, sped up by union by rank and path compression, drives every operation to near-constant $O(\\alpha(n))$ amortized time — the engine behind connectivity queries and Kruskal's minimum spanning tree.",{"title":114,"path":115,"lessonNumber":116,"topics":117,"summary":119},"Fenwick & Segment Trees","\u002Falgorithms\u002Fdata-structures\u002Ffenwick-and-segment-trees",7,[118],"Range Queries","A prefix-sum array answers a range sum in $O(1)$ but pays $O(n)$ per update; a plain array updates in $O(1)$ but pays $O(n)$ per range sum. Fenwick and segment trees give us _both_ in $O(\\log n)$. The Fenwick (binary indexed) tree is a tiny array keyed by the low bit; the segment tree is a general balanced tree over canonical ranges that handles any associative aggregate and, with lazy propagation, range updates too.",{"module":121,"moduleNumber":102,"slug":122,"lessons":123},"Sequences & Strings","sequences",[124,130,135,141,147],{"title":125,"path":126,"lessonNumber":6,"topics":127,"summary":129},"Two Pointers, Sliding Windows & Prefix Sums","\u002Falgorithms\u002Fsequences\u002Ftwo-pointers-and-windows",[128],"Array Techniques","A family of array idioms that collapse an obvious $O(n^2)$ scan into a single $O(n)$ pass by maintaining an invariant as indices move. We meet two pointers (converging on a sorted array, and a fast\u002Fslow pair for in-place rewriting), the sliding window (fixed and variable size, amortized $O(n)$), and prefix sums, which answer any range-sum in $O(1)$ and count subarrays summing to $k$.",{"title":131,"path":132,"lessonNumber":18,"topics":133,"summary":134},"Monotonic Stacks & Queues","\u002Falgorithms\u002Fsequences\u002Fmonotonic-stacks",[128],"A **monotonic stack** keeps its contents sorted by popping every element that would break the order before each push — turning a family of \"previous\u002Fnext greater (or smaller) element\" questions into a single $O(n)$ scan. We derive the next-greater-element routine and its amortized analysis, fuse two such scans to measure the **largest rectangle in a histogram** in linear time, and extend the idea to a **monotonic deque** that streams the **sliding-window maximum** in $O(n)$.",{"title":136,"path":137,"lessonNumber":24,"topics":138,"summary":140},"Binary Search on the Answer","\u002Falgorithms\u002Fsequences\u002Fbinary-search-on-the-answer",[139],"Searching","Binary search is not really about arrays — it is about locating the boundary of a **monotone predicate** $p(x)$ in $O(\\log(\\text{range}))$ probes. We first pin down the half-open `while (lo \u003C hi)` template for $\\textsc{lower\\_bound}$ and $\\textsc{upper\\_bound}$, then generalize to \"binary search on the answer\": whenever feasibility is monotone in a numeric parameter, we binary search the parameter itself, calling a feasibility check at each step.",{"title":142,"path":143,"lessonNumber":73,"topics":144,"summary":146},"String Matching: Rabin–Karp, KMP & Z","\u002Falgorithms\u002Fsequences\u002Fstring-matching",[145],"Strings","Given a text $T$ of length $n$ and a pattern $P$ of length $m$, find every occurrence of $P$ in $T$. The naive scan costs $O(nm)$; we beat it three ways. Rabin–Karp uses a **rolling hash** to test alignments in $O(1)$ amortised each, with expected $O(n+m)$. KMP precomputes a **failure function** so the scan never re-reads a text character, for worst-case $O(n+m)$. The **Z-function** gives the same bound from a different angle and converts freely to KMP's table.",{"title":148,"path":149,"lessonNumber":102,"topics":150,"summary":151},"Tries & Prefix Trees","\u002Falgorithms\u002Fsequences\u002Ftries",[145],"A **trie** stores a set of strings in a tree keyed by _characters_, so that insert, search, and prefix-test all run in $O(L)$ time — the length of the key, _independent of how many keys are stored_. Shared prefixes are stored once, which makes tries the natural structure for autocomplete, wildcard dictionaries, board word-search, and — over the alphabet $\\{0,1\\}$ — the maximum-XOR-pair problem.",{"module":153,"moduleNumber":108,"slug":154,"lessons":155},"Graphs","graphs",[156,163,168,173,178,183,188,193,199],{"title":157,"path":158,"lessonNumber":6,"topics":159,"summary":162},"Graph Representations and Traversal","\u002Falgorithms\u002Fgraphs\u002Frepresentations-and-traversal",[160,161],"Graph Representations","Graph Traversal","A graph captures _relationships_ — who connects to whom. We fix the vocabulary, weigh the two standard representations (adjacency list versus matrix), then meet the two explorations you'll use constantly: breadth-first search, which finds shortest paths by number of edges, and depth-first search, whose discovery and finish times reveal a graph's hidden structure. Both run in $O(V + E)$.",{"title":164,"path":165,"lessonNumber":18,"topics":166,"summary":167},"Topological Sort and Strong Connectivity","\u002Falgorithms\u002Fgraphs\u002Ftopological-sort-and-scc",[161],"Directed acyclic graphs model dependencies: tasks that must precede other tasks. A _topological order_ lays such a graph out in a line so every edge points forward, and depth-first finish times hand it to us almost for free. We then ask the harder question for graphs _with_ cycles: which vertices can reach each other? The answer is the strongly connected components, found by a two-pass DFS.",{"title":169,"path":170,"lessonNumber":24,"topics":171,"summary":172},"Minimum Spanning Trees","\u002Falgorithms\u002Fgraphs\u002Fminimum-spanning-trees",[169],"Given a weighted network, how do we connect everything as cheaply as possible? The answer is a minimum spanning tree. One lemma, the cut property, justifies _every_ correct MST algorithm, and from it two famous greedy methods fall out: Kruskal's, which grows a forest edge by edge with a union-find structure, and Prim's, which grows a single tree using a priority queue.",{"title":174,"path":175,"lessonNumber":73,"topics":176,"summary":177},"Shortest Paths","\u002Falgorithms\u002Fgraphs\u002Fshortest-paths",[174],"Finding the cheapest route through a weighted network is one of the most-used algorithms in computing. A single operation — _relaxation_ — underlies them all. Dijkstra's algorithm solves the non-negative case greedily; Bellman-Ford handles negative edges and detects negative cycles; and Floyd-Warshall finds the shortest path between _every_ pair of vertices.",{"title":179,"path":180,"lessonNumber":102,"topics":181,"summary":182},"Network Flow","\u002Falgorithms\u002Fgraphs\u002Fnetwork-flow",[179],"How much can flow through a network from source to sink? Max-flow is a surprisingly general model — once you see a problem as flow, a whole toolbox opens up. We build flow networks, find maximum flows by repeatedly pushing along augmenting paths in the residual graph, prove the max-flow min-cut theorem, and watch bipartite matching fall out as a special case.",{"title":184,"path":185,"lessonNumber":108,"topics":186,"summary":187},"Bridges & Articulation Points","\u002Falgorithms\u002Fgraphs\u002Fbridges-and-articulation-points",[153],"A **bridge** is an edge whose removal disconnects the graph; an **articulation point** is a vertex whose removal does. Both are single points of failure in a network. A single depth-first search computes discovery times and **low-links**, and two local criteria — $low[v] > disc[u]$ for bridges, $low[v] \\ge disc[u]$ for cut vertices — find them all in $O(V+E)$.",{"title":189,"path":190,"lessonNumber":116,"topics":191,"summary":192},"Lowest Common Ancestor & Binary Lifting","\u002Falgorithms\u002Fgraphs\u002Flowest-common-ancestor",[153],"Given a rooted tree, the lowest common ancestor of $u$ and $v$ is the deepest node that is an ancestor of both. A naive walk answers one query in $O(h)$; **binary lifting** precomputes the $2^k$-th ancestor of every node in $O(n\\log n)$, then answers $k$-th-ancestor and LCA queries in $O(\\log n)$ each. We derive both jumps, apply them to tree distance, and compare against the Euler-tour + RMQ and Tarjan offline alternatives.",{"title":194,"path":195,"lessonNumber":196,"topics":197,"summary":198},"2-SAT via Implication Graphs","\u002Falgorithms\u002Fgraphs\u002Ftwo-sat",8,[153],"A boolean formula whose every clause has exactly two literals can be solved in _linear_ time — even though its three-literal cousin is NP-complete. The trick is to read each clause as a pair of implications, build a directed graph on the $2n$ literals, and ask a question we already know how to answer: which literals share a strongly connected component? The formula is satisfiable iff no variable lands in the same SCC as its own negation, and the SCCs' topological order hands us a satisfying assignment for free.",{"title":200,"path":201,"lessonNumber":202,"topics":203,"summary":204},"Eulerian Tours","\u002Falgorithms\u002Fgraphs\u002Feulerian-tours",9,[153],"An **Eulerian tour** uses every _edge_ of a graph exactly once. We give the exact parity and balance conditions under which one exists (even degree for undirected graphs, in-degree equal to out-degree for directed) and Hierholzer's $O(E)$ algorithm that constructs one by splicing closed sub-tours. We contrast this sharply with the **Hamiltonian** problem (visit every _vertex_ once), which is NP-complete: visiting edges is easy, visiting vertices is hard.",{"module":206,"moduleNumber":116,"slug":207,"lessons":208},"Greedy Algorithms","greedy",[209,214,220,225],{"title":210,"path":211,"lessonNumber":6,"topics":212,"summary":213},"The Greedy Method","\u002Falgorithms\u002Fgreedy\u002Fthe-greedy-method",[206],"A greedy algorithm builds a solution one locally-best choice at a time and never looks back. We pin down the two properties that make this work — the greedy-choice property and optimal substructure — prove the canonical activity-selection algorithm correct with an exchange argument, watch greedy fail spectacularly on the 0\u002F1 knapsack, and glimpse matroids as the theory that says exactly when greed is good.",{"title":215,"path":216,"lessonNumber":18,"topics":217,"summary":219},"Scheduling & Interval Partitioning","\u002Falgorithms\u002Fgreedy\u002Fscheduling-and-intervals",[218],"Greedy","Three classic scheduling problems all yield to greedy algorithms — and all three turn on a single design decision: which key to sort by. Interval scheduling sorts by **finish** time to pack the most compatible jobs; interval partitioning sorts by **start** time and proves the rooms needed equal the maximum overlap **depth**; minimizing maximum lateness sorts by **deadline** and is justified by an adjacent-swap exchange argument.",{"title":221,"path":222,"lessonNumber":24,"topics":223,"summary":224},"Huffman Codes","\u002Falgorithms\u002Fgreedy\u002Fhuffman-codes",[206],"Huffman coding is the greedy method's most beautiful application: it builds a provably optimal prefix-free binary code by repeatedly merging the two least frequent symbols. We develop prefix-free codes as binary trees, give the algorithm with a priority queue, build a Huffman tree from example frequencies, prove optimality with the same greedy-choice-plus-substructure argument, and pin the running time at $O(n\\log n)$.",{"title":226,"path":227,"lessonNumber":73,"topics":228,"summary":229},"Matroids & Exchange Arguments","\u002Falgorithms\u002Fgreedy\u002Fmatroids",[218],"The capstone of the greedy module: _why_ and _when_ a greedy algorithm is provably optimal. We recap the two correctness templates — **greedy-stays-ahead** and the **exchange argument** — then meet the **matroid** $M=(S,\\mathcal{I})$, an abstraction whose **exchange property** is exactly the structure greedy needs. The matroid–greedy theorem says sorting by weight and taking what stays independent yields a maximum-weight basis _if and only if_ the structure is a matroid. Kruskal's MST is the canonical instance; 0\u002F1 knapsack and TSP are the canonical failures.",{"module":231,"moduleNumber":196,"slug":232,"lessons":233},"Dynamic Programming","dynamic-programming",[234,239,245,250,255,260,265,270,275,280],{"title":235,"path":236,"lessonNumber":6,"topics":237,"summary":238},"Principles of Dynamic Programming","\u002Falgorithms\u002Fdynamic-programming\u002Fprinciples",[231,26],"Dynamic programming is recursion with memory: when a recursive solution re-solves the same subproblems again and again, we solve each one once and store the answer. We pin down the two structural conditions that make this work — overlapping subproblems and optimal substructure — contrast top-down memoization with bottom-up tabulation, and distil the whole method into a five-step recipe.",{"title":240,"path":241,"lessonNumber":18,"topics":242,"summary":244},"Sequence Alignment & LCS","\u002Falgorithms\u002Fdynamic-programming\u002Fsequence-dp",[231,243],"String Structures","Two strings can be compared by asking how much of one survives inside the other. The longest common subsequence (LCS) and edit distance are the two classic answers, and they are the _same_ dynamic program wearing different costs. We derive the LCS recurrence by examining the last characters, fill a worked DP table, reconstruct the subsequence, and then show edit distance as the identical $\\Theta(mn)$ pattern.",{"title":246,"path":247,"lessonNumber":24,"topics":248,"summary":249},"Longest Increasing Subsequence","\u002Falgorithms\u002Fdynamic-programming\u002Flongest-increasing-subsequence",[231],"Given a sequence of numbers, how long is its longest strictly increasing subsequence? A first dynamic program indexes subproblems by the element each subsequence _ends at_, giving an $O(n^2)$ solution with parent-pointer reconstruction. A sharper idea, the patience-sorting _tails_ array searched by binary search, drops the time to $O(n\\log n)$. We then fold in the variants: non-decreasing, counting, Russian-doll envelopes, and bitonic.",{"title":251,"path":252,"lessonNumber":73,"topics":253,"summary":254},"Knapsack & Subset Problems","\u002Falgorithms\u002Fdynamic-programming\u002Fknapsack",[231],"We start from $\\textsc{Subset-sum}$ — does some sublist hit a target $t$? — and its include\u002Fexclude recurrence over a boolean table $A(i, u)$, then bolt on values to get 0\u002F1 knapsack as the same machine with $\\lor$ promoted to $\\max$. We fill both tables, recover the chosen items, and confront the surprise that the $\\Theta(nt)$ running time is only _pseudo-polynomial_ — exponential in the bit length $b$, and unimprovable unless $\\mathrm{P}=\\mathrm{NP}$ since subset-sum is $\\textsc{NP-complete}$. The fractional variant reveals the sharp line between greedy and dynamic programming.",{"title":256,"path":257,"lessonNumber":102,"topics":258,"summary":259},"Coin Change & Unbounded Knapsack","\u002Falgorithms\u002Fdynamic-programming\u002Fcoin-change-and-unbounded",[231],"The previous lesson let each item be taken at most once. Drop that cap — items may be reused _any number of times_ — and the 0\u002F1 knapsack collapses from a two-dimensional table to a one-dimensional one, because there is no longer a prefix of \"already-used\" items to track. We meet **unbounded knapsack**, then its most famous instance, **coin change**: the minimum-coins recurrence $C[a] = 1 + \\min_c C[a-c]$, and the counting variant where the _order of the loops_ decides whether you count unordered combinations or ordered sequences — the classic bug. Greed fails in general but works for canonical coin systems.",{"title":261,"path":262,"lessonNumber":108,"topics":263,"summary":264},"Interval DP","\u002Falgorithms\u002Fdynamic-programming\u002Finterval-dp",[231],"Many problems ask for the best way to combine a contiguous range of items, and the answer is a dynamic program over subintervals $[i,j]$ that chooses a split point $k$. We derive the pattern from matrix-chain multiplication — parenthesising a product to minimize scalar multiplications in $O(n^3)$ — distil it into a reusable template filled by increasing interval length, and then meet its sharpest variant: the \"last operation\" trick behind Burst Balloons and cutting a stick, where fixing the _last_ move (not the first) makes the two sides independent.",{"title":266,"path":267,"lessonNumber":116,"topics":268,"summary":269},"Dynamic Programming on Trees","\u002Falgorithms\u002Fdynamic-programming\u002Ftree-dp",[231],"When the subproblems of a dynamic program are _rooted subtrees_, a single post-order DFS solves the whole thing in $O(n)$: each node combines the already-computed answers of its children. We meet the archetype — maximum-weight independent set on a tree — then the \"path through a node\" pattern behind tree diameter and maximum path sum, and finally **rerooting**, which computes a per-node answer for _every_ node as root in $O(n)$ with two passes.",{"title":271,"path":272,"lessonNumber":196,"topics":273,"summary":274},"Bitmask DP","\u002Falgorithms\u002Fdynamic-programming\u002Fbitmask-dp",[231],"When a subproblem depends not on an index or a prefix but on _which subset_ of a small ground set has been used, we can encode that subset as the bits of an integer and index a DP table by it. With $n \\le \\sim 20$ the $2^n$ subsets fit in a table, turning $\\Theta(n!)$ brute force into $O(2^n \\cdot \\text{poly}(n))$. We meet the bit tricks, the Held–Karp TSP archetype, assignment by mask, subset-sum partitioning, and submask enumeration with its $3^n$ bound.",{"title":276,"path":277,"lessonNumber":202,"topics":278,"summary":279},"DP Optimizations","\u002Falgorithms\u002Fdynamic-programming\u002Fdp-optimizations",[231],"A correct DP recurrence is only half the battle; its naive evaluation is often a factor of $n$ slower than necessary. This capstone surveys five techniques, monotonic-queue, the convex hull trick, divide-and-conquer optimization, Knuth's optimization, and SOS DP, that each exploit _structure in the transition_ (a sliding window, linear costs, monotone optimal splits, the quadrangle inequality, or subset lattices) to shave an $O(n)$, $O(\\log n)$, or worse factor off the running time.",{"title":281,"path":282,"lessonNumber":283,"topics":284,"summary":285},"Dynamic Programming on Graphs","\u002Falgorithms\u002Fdynamic-programming\u002Fdp-on-graphs",10,[231],"Many graph algorithms are dynamic programs in disguise: the subproblem is the _best value reachable under a restricted resource_ — intermediate vertices allowed, edges allowed, or a topological prefix — and edge _relaxation_ is the DP transition. We frame Floyd–Warshall as the archetype ($O(V^3)$ all-pairs shortest paths), Bellman–Ford as a DP over path length (the at-most-$K$-stops variant), DAG-DP in topological order ($O(V+E)$), and Warshall's transitive closure as the boolean analog.",{"module":287,"moduleNumber":202,"slug":288,"lessons":289},"Backtracking & Search","backtracking",[290,296,301],{"title":291,"path":292,"lessonNumber":6,"topics":293,"summary":295},"Backtracking: Subsets, Permutations & Combinations","\u002Falgorithms\u002Fbacktracking\u002Fbacktracking-fundamentals",[294],"Backtracking","Backtracking builds a solution one choice at a time and abandons a partial solution the moment it cannot be completed, exploring a state-space tree by depth-first search. We meet the universal choose\u002Fexplore\u002Fun-choose template, derive the canonical enumerations — subsets ($2^n$), permutations ($n!$), and combinations ($\\binom{n}{k}$) — handle duplicate elements by skipping equal siblings, and see how pruning turns an exponential search into a tractable one.",{"title":297,"path":298,"lessonNumber":18,"topics":299,"summary":300},"Constraint Search: N-Queens & Sudoku","\u002Falgorithms\u002Fbacktracking\u002Fconstraint-search",[294],"Many hard puzzles are **constraint satisfaction problems**: assign each variable a value from its domain so that every constraint holds. Backtracking solves them by assigning variables one at a time and rejecting a partial assignment the instant a constraint breaks. We make the rejection cheap — $O(1)$ conflict checks for N-Queens via column and diagonal sets — and prune harder with **forward checking**, **MRV** ordering, and **constraint propagation**, which is what lets an exponential search actually finish.",{"title":302,"path":303,"lessonNumber":24,"topics":304,"summary":305},"Branch & Bound and Meet in the Middle","\u002Falgorithms\u002Fbacktracking\u002Fbranch-and-bound",[294],"Plain backtracking prunes a search tree by _feasibility_; for _optimization_ problems we can prune far more aggressively by _value_. **Branch and bound** keeps the best complete solution found so far and discards any partial solution whose optimistic bound cannot beat it. **Meet in the middle** splits the instance in two, enumerates each half, and recombines by binary search — turning $2^n$ into $O(2^{n\u002F2}\\,n)$ and pushing exact search out to $n \\approx 40$.",{"module":307,"moduleNumber":283,"slug":308,"lessons":309},"Mathematical Algorithms","mathematical-algorithms",[310,316,321,326],{"title":311,"path":312,"lessonNumber":6,"topics":313,"summary":315},"Number Theory: GCD & Modular Arithmetic","\u002Falgorithms\u002Fmathematical-algorithms\u002Fnumber-theory-basics",[314],"Number Theory","This lesson opens the mathematical-algorithms module with the bedrock of computational number theory. We prove Euclid's recurrence $\\gcd(a,b)=\\gcd(b,\\,a\\bmod b)$ and its $O(\\log\\min(a,b))$ running time, extend it to recover Bézout coefficients $x,y$ with $ax+by=\\gcd(a,b)$, and build modular arithmetic on residue classes — including when a modular inverse $a^{-1}\\bmod m$ exists and how to compute it.",{"title":317,"path":318,"lessonNumber":18,"topics":319,"summary":320},"Modular Exponentiation & Primality","\u002Falgorithms\u002Fmathematical-algorithms\u002Fmodular-exponentiation-and-primality",[314],"Computing $a^n \\bmod m$ naively costs $n$ multiplications; **repeated squaring** does it in $O(\\log n)$ by reading the bits of the exponent. We use this routine to state **Fermat's little theorem** (and the modular inverse it gives), then to test primality — trial division, the probabilistic **Fermat** and **Miller–Rabin** tests, and the deterministic witness set that settles primality for every 64-bit number.",{"title":322,"path":323,"lessonNumber":24,"topics":324,"summary":325},"Sieves & Factorization","\u002Falgorithms\u002Fmathematical-algorithms\u002Fsieve-and-factorization",[314],"The previous lesson tested one number for primality; here we ask for _all_ primes up to $n$ at once. The **sieve of Eratosthenes** cross-cuts composites in $O(n\\log\\log n)$, and a **linear sieve** does it in $O(n)$ while recording each number's **smallest prime factor**, which then factors any $x \\le n$ in $O(\\log x)$. From a factorization $x = \\prod p_i^{e_i}$ the multiplicative functions $\\tau$, $\\sigma$, and Euler's totient $\\varphi$ fall out immediately.",{"title":327,"path":328,"lessonNumber":73,"topics":329,"summary":330},"Combinatorics & Counting","\u002Falgorithms\u002Fmathematical-algorithms\u002Fcombinatorics",[314],"Counting is the arithmetic of finite sets. We build up from permutations $n!$ and combinations $\\binom{n}{k}$, prove Pascal's rule by a bijection, and count multisets with stars and bars. The practical core is computing $\\binom{n}{k}\\bmod p$ in $O(1)$ from precomputed factorials and inverse factorials. We close with inclusion–exclusion and the Chinese Remainder Theorem, both of which lean on the modular inverse from the previous lesson.",{"module":332,"moduleNumber":333,"slug":334,"lessons":335},"Computational Geometry",11,"computational-geometry",[336,342,347],{"title":337,"path":338,"lessonNumber":6,"topics":339,"summary":341},"Geometric Primitives & Orientation","\u002Falgorithms\u002Fcomputational-geometry\u002Fgeometric-primitives",[340],"Geometry","Computational geometry is built on a single reliable primitive — the **orientation test**, a sign of a cross product that tells whether three points turn left, right, or lie collinear. From points-as-vectors and the dot and cross products we derive orientation, segment intersection, the shoelace area formula, and point-in-polygon tests, keeping all arithmetic **exact and integer** so that no floating-point rounding can corrupt a sign.",{"title":343,"path":344,"lessonNumber":18,"topics":345,"summary":346},"Convex Hull","\u002Falgorithms\u002Fcomputational-geometry\u002Fconvex-hull",[340],"The convex hull is the smallest convex polygon enclosing a point set — the rubber band snapped around the nails. We build it with Andrew's monotone chain, sorting by $(x,y)$ and sweeping a lower and upper hull while popping any non-left turn via the orientation primitive, in $O(n\\log n)$. A reduction from sorting shows that bound is optimal, and the hull unlocks diameter, smallest enclosing rectangle, and more through rotating calipers.",{"title":348,"path":349,"lessonNumber":24,"topics":350,"summary":351},"Sweep-Line Algorithms","\u002Falgorithms\u002Fcomputational-geometry\u002Fsweep-line",[340],"The plane-sweep paradigm turns a static $2$-D geometry problem into a dynamic $1$-D ordered-set problem: a vertical line sweeps left to right, stopping at an $x$-sorted **event queue** while a balanced-BST **status structure** tracks the objects it currently crosses, ordered by $y$. We derive Bentley–Ottmann segment intersection in $O((n+k)\\log n)$, recover closest-pair in $O(n\\log n)$, and reduce skyline, rectangle-area, and overlap problems to $\\pm1$ event sweeps.",{"module":353,"moduleNumber":354,"slug":355,"lessons":356},"Intractability",12,"intractability",[357,363,367],{"title":358,"path":359,"lessonNumber":6,"topics":360,"summary":362},"P, NP, and Reductions","\u002Falgorithms\u002Fintractability\u002Fp-np-reductions",[361],"NP-Completeness","Most problems we have met so far have fast algorithms. A vast and important family seemingly does not. This lesson builds the vocabulary for that divide: decision problems, the class $\\mathsf{P}$ of problems we can solve quickly, the class $\\mathsf{NP}$ of problems whose solutions we can _check_ quickly, and polynomial-time reductions, the tool that lets us compare the difficulty of two problems without solving either.",{"title":361,"path":364,"lessonNumber":18,"topics":365,"summary":366},"\u002Falgorithms\u002Fintractability\u002Fnp-completeness",[361],"Some problems in $\\mathsf{NP}$ are universally hardest: every other problem in $\\mathsf{NP}$ reduces to them. This lesson defines $\\mathsf{NP}$-hard and $\\mathsf{NP}$-complete, states the Cook–Levin theorem that anchors the whole edifice on **SAT**, walks the web of reductions that grows from it, and gives the four-step recipe for proving a brand-new problem $\\mathsf{NP}$-complete.",{"title":368,"path":369,"lessonNumber":24,"topics":370,"summary":373},"Coping with NP-Hardness","\u002Falgorithms\u002Fintractability\u002Fcoping-with-hardness",[371,372],"Approximation","Heuristics","Proving a problem $\\mathsf{NP}$-hard is the beginning, not the end. The world still needs answers. This lesson surveys the four honest responses to hardness: approximation algorithms with a provable ratio (worked through a 2-approximation for vertex cover), heuristics and local search, exact exponential methods like branch and bound, and exploiting special structure in the instances you actually face.",{"id":375,"title":235,"blurb":376,"body":377,"description":10763,"extension":10764,"meta":10765,"module":231,"navigation":10767,"path":236,"practice":10768,"rawbody":10786,"readingTime":10787,"seo":10792,"sources":10793,"status":10800,"stem":10801,"summary":238,"topics":10802,"__hash__":10803},"course\u002F01.algorithms\u002F08.dynamic-programming\u002F01.principles.md","",{"type":378,"value":379,"toc":10752},"minimark",[380,405,412,417,420,859,862,897,926,1227,1643,1760,1764,1771,1820,1908,1945,2149,2422,2426,2445,2485,2544,2605,2985,3053,3057,3064,3077,3090,3099,3103,3114,3281,3291,3295,3310,4092,4224,4551,4713,4763,4983,5273,5354,5841,5903,6487,6874,7386,7495,7540,7760,7805,7928,8053,8147,8394,8468,8669,8673,8768,8905,9046,9315,9661,9731,9769,9877,10248,10457,10492,10496,10695,10748],[381,382,383,387,388,392,393,404],"p",{},[384,385,386],"strong",{},"Dynamic programming"," is one of the most powerful and most misunderstood\nideas in algorithm design. The name, coined by Richard Bellman in the 1950s, is\na historical accident: it has nothing to do with dynamics and little to do with\nprogramming in the modern sense. Erickson gives a one-line definition\nthat cuts through the mystique: dynamic programming is ",[389,390,391],"em",{},"recursion without\nrepetition",".",[394,395,396],"sup",{},[397,398,403],"a",{"href":399,"ariaDescribedBy":400,"dataFootnoteRef":376,"id":402},"#user-content-fn-erickson-dp",[401],"footnote-label","user-content-fnref-erickson-dp","1"," We find a recursive structure for the problem, notice that the\nnaive recursion solves the same subproblems over and over, and then arrange to\nsolve each distinct subproblem exactly once, remembering its answer.",[381,406,407,408,411],{},"That single move, trading repeated computation for stored results, can\ncollapse an exponential running time to a polynomial one. The rest is bookkeeping:\nidentifying the subproblems, writing the ",[397,409,410],{"href":23},"recurrence"," that relates them, and\ndeciding the order in which to fill in the answers.",[413,414,416],"h2",{"id":415},"a-motivating-disaster-fibonacci","A motivating disaster: Fibonacci",[381,418,419],{},"The Fibonacci numbers are defined by the recurrence",[421,422,425],"span",{"className":423},[424],"katex-display",[421,426,429],{"className":427},[428],"katex",[421,430,434,477],{"className":431,"ariaHidden":433},[432],"katex-html","true",[421,435,438,443,450,455,459,464,469,474],{"className":436},[437],"base",[421,439],{"className":440,"style":442},[441],"strut","height:1em;vertical-align:-0.25em;",[421,444,449],{"className":445,"style":448},[446,447],"mord","mathnormal","margin-right:0.1389em;","F",[421,451,454],{"className":452},[453],"mopen","(",[421,456,458],{"className":457},[446,447],"n",[421,460,463],{"className":461},[462],"mclose",")",[421,465],{"className":466,"style":468},[467],"mspace","margin-right:0.2778em;",[421,470,473],{"className":471},[472],"mrel","=",[421,475],{"className":476,"style":468},[467],[421,478,480,484],{"className":479},[437],[421,481],{"className":482,"style":483},[441],"height:4.8em;vertical-align:-2.15em;",[421,485,488,598,855],{"className":486},[487],"minner",[421,489,491],{"className":490},[453],[421,492,496],{"className":493},[494,495],"delimsizing","mult",[421,497,501,589],{"className":498},[499,500],"vlist-t","vlist-t2",[421,502,505,584],{"className":503},[504],"vlist-r",[421,506,510,526,548,560,572],{"className":507,"style":509},[508],"vlist","height:2.65em;",[421,511,513,518],{"style":512},"top:-1.9em;",[421,514],{"className":515,"style":517},[516],"pstrut","height:3.15em;",[421,519,523],{"className":520},[521,522],"delimsizinginner","delim-size4",[421,524,525],{},"⎩",[421,527,529,532],{"style":528},"top:-1.892em;",[421,530],{"className":531,"style":517},[516],[421,533,535],{"style":534},"height:0.616em;width:0.8889em;",[536,537,544],"svg",{"xmlns":538,"width":539,"height":540,"style":541,"viewBox":542,"preserveAspectRatio":543},"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","0.8889em","0.616em","width:0.8889em","0 0 888.89 616","xMinYMin",[545,546],"path",{"d":547},"M384 0 H504 V616 H384z M384 0 H504 V616 H384z",[421,549,551,554],{"style":550},"top:-3.15em;",[421,552],{"className":553,"style":517},[516],[421,555,557],{"className":556},[521,522],[421,558,559],{},"⎨",[421,561,563,566],{"style":562},"top:-4.292em;",[421,564],{"className":565,"style":517},[516],[421,567,568],{"style":534},[536,569,570],{"xmlns":538,"width":539,"height":540,"style":541,"viewBox":542,"preserveAspectRatio":543},[545,571],{"d":547},[421,573,575,578],{"style":574},"top:-4.9em;",[421,576],{"className":577,"style":517},[516],[421,579,581],{"className":580},[521,522],[421,582,583],{},"⎧",[421,585,588],{"className":586},[587],"vlist-s","​",[421,590,592],{"className":591},[504],[421,593,596],{"className":594,"style":595},[508],"height:2.15em;",[421,597],{},[421,599,601],{"className":600},[446],[421,602,605,728,733],{"className":603},[604],"mtable",[421,606,609],{"className":607},[608],"col-align-l",[421,610,612,719],{"className":611},[499,500],[421,613,615,716],{"className":614},[504],[421,616,619,633,645],{"className":617,"style":618},[508],"height:2.61em;",[421,620,622,626],{"style":621},"top:-4.61em;",[421,623],{"className":624,"style":625},[516],"height:3.008em;",[421,627,629],{"className":628},[446],[421,630,632],{"className":631},[446],"0",[421,634,636,639],{"style":635},"top:-2.97em;",[421,637],{"className":638,"style":625},[516],[421,640,642],{"className":641},[446],[421,643,403],{"className":644},[446],[421,646,648,651],{"style":647},"top:-1.33em;",[421,649],{"className":650,"style":625},[516],[421,652,654,657,660,663,667,672,675,678,681,684,688,691,694,697,700,703,706,709,713],{"className":653},[446],[421,655,449],{"className":656,"style":448},[446,447],[421,658,454],{"className":659},[453],[421,661,458],{"className":662},[446,447],[421,664],{"className":665,"style":666},[467],"margin-right:0.2222em;",[421,668,671],{"className":669},[670],"mbin","−",[421,673],{"className":674,"style":666},[467],[421,676,403],{"className":677},[446],[421,679,463],{"className":680},[462],[421,682],{"className":683,"style":666},[467],[421,685,687],{"className":686},[670],"+",[421,689],{"className":690,"style":666},[467],[421,692,449],{"className":693,"style":448},[446,447],[421,695,454],{"className":696},[453],[421,698,458],{"className":699},[446,447],[421,701],{"className":702,"style":666},[467],[421,704,671],{"className":705},[670],[421,707],{"className":708,"style":666},[467],[421,710,712],{"className":711},[446],"2",[421,714,463],{"className":715},[462],[421,717,588],{"className":718},[587],[421,720,722],{"className":721},[504],[421,723,726],{"className":724,"style":725},[508],"height:2.11em;",[421,727],{},[421,729],{"className":730,"style":732},[731],"arraycolsep","width:1em;",[421,734,736],{"className":735},[608],[421,737,739,847],{"className":738},[499,500],[421,740,742,844],{"className":741},[504],[421,743,745,781,813],{"className":744,"style":618},[508],[421,746,747,750],{"style":621},[421,748],{"className":749,"style":625},[516],[421,751,753,761,764,767,770,773,776],{"className":752},[446],[421,754,757],{"className":755},[446,756],"text",[421,758,760],{"className":759},[446],"if ",[421,762,458],{"className":763},[446,447],[421,765],{"className":766,"style":468},[467],[421,768,473],{"className":769},[472],[421,771],{"className":772,"style":468},[467],[421,774,632],{"className":775},[446],[421,777,780],{"className":778},[779],"mpunct",",",[421,782,783,786],{"style":635},[421,784],{"className":785,"style":625},[516],[421,787,789,795,798,801,804,807,810],{"className":788},[446],[421,790,792],{"className":791},[446,756],[421,793,760],{"className":794},[446],[421,796,458],{"className":797},[446,447],[421,799],{"className":800,"style":468},[467],[421,802,473],{"className":803},[472],[421,805],{"className":806,"style":468},[467],[421,808,403],{"className":809},[446],[421,811,780],{"className":812},[779],[421,814,815,818],{"style":647},[421,816],{"className":817,"style":625},[516],[421,819,821,827,830,833,837,840],{"className":820},[446],[421,822,824],{"className":823},[446,756],[421,825,760],{"className":826},[446],[421,828,458],{"className":829},[446,447],[421,831],{"className":832,"style":468},[467],[421,834,836],{"className":835},[472],"≥",[421,838],{"className":839,"style":468},[467],[421,841,843],{"className":842},[446],"2.",[421,845,588],{"className":846},[587],[421,848,850],{"className":849},[504],[421,851,853],{"className":852,"style":725},[508],[421,854],{},[421,856],{"className":857},[462,858],"nulldelimiter",[381,860,861],{},"Transcribed directly into a recursive procedure, this definition is correct and\ncatastrophically slow.",[863,864,868],"pre",{"className":865,"code":866,"language":867,"meta":376,"style":376},"language-algorithm shiki shiki-themes Vesper Light - Orange Boost (Quick Open Adjusted) vesper","caption: $\\textsc{Rec-Fib}(n)$ — naive recursive Fibonacci\nnumber: 1\nif $n \u003C 2$ then\n  return $n$\nreturn $\\textsc{Rec-Fib}(n-1)$ **+** $\\textsc{Rec-Fib}(n-2)$\n","algorithm",[869,870,871,877,882,887,892],"code",{"__ignoreMap":376},[421,872,874],{"class":873,"line":6},"line",[421,875,876],{},"caption: $\\textsc{Rec-Fib}(n)$ — naive recursive Fibonacci\n",[421,878,879],{"class":873,"line":18},[421,880,881],{},"number: 1\n",[421,883,884],{"class":873,"line":24},[421,885,886],{},"if $n \u003C 2$ then\n",[421,888,889],{"class":873,"line":73},[421,890,891],{},"  return $n$\n",[421,893,894],{"class":873,"line":102},[421,895,896],{},"return $\\textsc{Rec-Fib}(n-1)$ **+** $\\textsc{Rec-Fib}(n-2)$\n",[381,898,899,900,925],{},"Why is it slow? Because it recomputes the same values an astronomical number of\ntimes. The recursion tree for ",[421,901,903],{"className":902},[428],[421,904,906],{"className":905,"ariaHidden":433},[432],[421,907,909,912,915,918,922],{"className":908},[437],[421,910],{"className":911,"style":442},[441],[421,913,449],{"className":914,"style":448},[446,447],[421,916,454],{"className":917},[453],[421,919,921],{"className":920},[446],"5",[421,923,463],{"className":924},[462]," shows the waste already:",[927,928,932,1196],"figure",{"className":929},[930,931],"tikz-figure","tikz-diagram-rendered",[536,933,937],{"xmlns":538,"width":934,"height":935,"viewBox":936},"297.505","202.012","-75 -75 223.129 151.509",[938,939,942,946,964,967,981,984,998,1001,1015,1018,1032,1035,1049,1052,1065,1068,1081,1084,1097,1100,1113,1116,1129,1132,1145,1148,1161,1164,1177,1180,1193],"g",{"stroke":940,"style":941},"currentColor","stroke-miterlimit:10;stroke-width:.4",[545,943],{"fill":944,"d":945},"none","M63.568-62.112c0-5.5-4.458-9.958-9.958-9.958s-9.958 4.458-9.958 9.958 4.458 9.959 9.958 9.959 9.958-4.459 9.958-9.959Zm-9.958 0",[938,947,948,957],{"stroke":944},[938,949,951],{"transform":950},"translate(-5.458 2.667)",[545,952],{"d":953,"fill":940,"stroke":940,"className":954,"style":956},"M57.018-62.112L54.079-62.112Q53.981-62.112 53.981-62.244Q53.986-62.268 54.001-62.329Q54.015-62.390 54.042-62.427Q54.069-62.464 54.108-62.464Q54.718-62.464 54.958-62.532Q55.089-62.576 55.148-62.800L56.520-68.294Q56.540-68.391 56.540-68.430Q56.540-68.538 56.418-68.552Q56.232-68.591 55.700-68.591Q55.602-68.591 55.602-68.723Q55.607-68.748 55.622-68.809Q55.636-68.870 55.663-68.906Q55.690-68.943 55.729-68.943L61.012-68.943Q61.110-68.943 61.110-68.811L60.871-66.741Q60.871-66.712 60.837-66.682Q60.802-66.653 60.768-66.653L60.680-66.653Q60.578-66.653 60.578-66.780Q60.641-67.234 60.641-67.522Q60.641-68.020 60.426-68.255Q60.212-68.489 59.884-68.540Q59.557-68.591 58.981-68.591L57.912-68.591Q57.638-68.591 57.550-68.545Q57.463-68.499 57.389-68.250L56.750-65.701L57.502-65.701Q57.873-65.701 58.102-65.740Q58.332-65.779 58.483-65.891Q58.634-66.004 58.735-66.216Q58.835-66.428 58.918-66.780Q58.947-66.873 59.020-66.873L59.108-66.873Q59.211-66.873 59.211-66.741L58.600-64.270Q58.556-64.182 58.498-64.182L58.410-64.182Q58.312-64.182 58.312-64.314Q58.337-64.417 58.351-64.485Q58.366-64.553 58.388-64.683Q58.410-64.812 58.410-64.910Q58.410-65.198 58.156-65.276Q57.902-65.354 57.492-65.354L56.672-65.354L56.022-62.761Q55.998-62.664 55.998-62.664Q55.998-62.547 56.071-62.532Q56.330-62.464 57.091-62.464Q57.189-62.464 57.189-62.332Q57.155-62.190 57.135-62.151Q57.116-62.112 57.018-62.112",[955],"tikz-text","stroke-width:0.300",[938,958,959],{"transform":950},[545,960],{"d":961,"fill":940,"stroke":940,"className":962,"style":963},"M60.848-61.374L60.817-61.374Q60.954-61.077 61.251-60.901Q61.548-60.725 61.876-60.725Q62.239-60.725 62.466-60.903Q62.693-61.080 62.787-61.369Q62.881-61.658 62.881-62.020Q62.881-62.335 62.827-62.620Q62.772-62.905 62.599-63.111Q62.427-63.316 62.112-63.316Q61.839-63.316 61.656-63.249Q61.473-63.182 61.369-63.093Q61.265-63.005 61.169-62.895Q61.073-62.786 61.029-62.776L60.950-62.776Q60.878-62.793 60.861-62.864L60.861-65.182Q60.861-65.216 60.885-65.238Q60.909-65.260 60.943-65.260L60.971-65.260Q61.258-65.144 61.526-65.090Q61.794-65.035 62.071-65.035Q62.348-65.035 62.618-65.090Q62.888-65.144 63.168-65.260L63.192-65.260Q63.227-65.260 63.250-65.237Q63.274-65.213 63.274-65.182L63.274-65.113Q63.274-65.086 63.254-65.066Q62.980-64.751 62.596-64.575Q62.211-64.399 61.798-64.399Q61.459-64.399 61.142-64.485L61.142-63.203Q61.538-63.538 62.112-63.538Q62.516-63.538 62.852-63.328Q63.189-63.117 63.382-62.765Q63.575-62.413 63.575-62.013Q63.575-61.682 63.435-61.396Q63.295-61.111 63.051-60.901Q62.806-60.691 62.504-60.581Q62.201-60.472 61.883-60.472Q61.524-60.472 61.198-60.636Q60.872-60.800 60.677-61.092Q60.482-61.384 60.482-61.747Q60.482-61.897 60.588-62.003Q60.694-62.109 60.848-62.109Q61.001-62.109 61.106-62.005Q61.210-61.901 61.210-61.747Q61.210-61.590 61.106-61.482Q61.001-61.374 60.848-61.374",[955],"stroke-width:0.210",[545,965],{"fill":944,"d":966},"M9.508-30.814c0-5.5-4.458-9.958-9.958-9.958s-9.959 4.458-9.959 9.958 4.459 9.959 9.959 9.959 9.958-4.459 9.958-9.959Zm-9.958 0",[938,968,969,975],{"stroke":944},[938,970,972],{"transform":971},"translate(-59.519 33.965)",[545,973],{"d":953,"fill":940,"stroke":940,"className":974,"style":956},[955],[938,976,977],{"transform":971},[545,978],{"d":979,"fill":940,"stroke":940,"className":980,"style":963},"M62.358-61.760L60.314-61.760L60.314-62.041L62.645-65.213Q62.680-65.260 62.745-65.260L62.881-65.260Q62.926-65.260 62.953-65.233Q62.980-65.206 62.980-65.161L62.980-62.041L63.743-62.041L63.743-61.760L62.980-61.760L62.980-61.101Q62.980-60.892 63.736-60.892L63.736-60.612L61.603-60.612L61.603-60.892Q62.358-60.892 62.358-61.101L62.358-61.760M62.406-64.485L60.615-62.041L62.406-62.041",[955],[545,982],{"fill":944,"d":983},"M44.819-57.022 8.34-35.903M-17.522.484c0-5.5-4.458-9.958-9.958-9.958S-37.44-5.015-37.44.484s4.459 9.959 9.959 9.959 9.958-4.459 9.958-9.959Zm-9.958 0",[938,985,986,992],{"stroke":944},[938,987,989],{"transform":988},"translate(-86.549 65.263)",[545,990],{"d":953,"fill":940,"stroke":940,"className":991,"style":956},[955],[938,993,994],{"transform":988},[545,995],{"d":996,"fill":940,"stroke":940,"className":997,"style":963},"M60.837-61.159Q60.957-61.002 61.148-60.903Q61.340-60.803 61.555-60.764Q61.770-60.725 61.993-60.725Q62.290-60.725 62.485-60.880Q62.680-61.036 62.770-61.290Q62.861-61.545 62.861-61.829Q62.861-62.123 62.769-62.374Q62.676-62.625 62.478-62.781Q62.280-62.936 61.986-62.936L61.470-62.936Q61.442-62.936 61.417-62.962Q61.391-62.987 61.391-63.011L61.391-63.083Q61.391-63.114 61.417-63.136Q61.442-63.158 61.470-63.158L61.911-63.189Q62.273-63.189 62.493-63.546Q62.714-63.904 62.714-64.293Q62.714-64.621 62.519-64.825Q62.324-65.028 61.993-65.028Q61.706-65.028 61.453-64.944Q61.200-64.861 61.036-64.673Q61.183-64.673 61.283-64.558Q61.384-64.444 61.384-64.293Q61.384-64.143 61.278-64.033Q61.172-63.924 61.015-63.924Q60.854-63.924 60.745-64.033Q60.636-64.143 60.636-64.293Q60.636-64.618 60.844-64.837Q61.053-65.055 61.369-65.158Q61.685-65.260 61.993-65.260Q62.311-65.260 62.639-65.156Q62.967-65.052 63.194-64.830Q63.421-64.608 63.421-64.293Q63.421-63.859 63.134-63.534Q62.847-63.210 62.413-63.063Q62.724-62.998 63.004-62.832Q63.285-62.666 63.462-62.408Q63.640-62.150 63.640-61.829Q63.640-61.419 63.396-61.109Q63.151-60.800 62.770-60.636Q62.389-60.472 61.993-60.472Q61.624-60.472 61.266-60.585Q60.909-60.697 60.665-60.947Q60.420-61.196 60.420-61.566Q60.420-61.737 60.537-61.849Q60.653-61.962 60.824-61.962Q60.933-61.962 61.024-61.911Q61.114-61.860 61.169-61.767Q61.224-61.675 61.224-61.566Q61.224-61.398 61.111-61.279Q60.998-61.159 60.837-61.159",[955],[545,999],{"fill":944,"d":1000},"M-7.09-23.126-20.84-7.203M-33.17 31.783c0-5.5-4.46-9.959-9.96-9.959s-9.958 4.459-9.958 9.959 4.459 9.958 9.959 9.958 9.958-4.459 9.958-9.958Zm-9.96 0",[938,1002,1003,1009],{"stroke":944},[938,1004,1006],{"transform":1005},"translate(-102.198 96.56)",[545,1007],{"d":953,"fill":940,"stroke":940,"className":1008,"style":956},[955],[938,1010,1011],{"transform":1005},[545,1012],{"d":1013,"fill":940,"stroke":940,"className":1014,"style":963},"M63.367-60.612L60.482-60.612L60.482-60.814Q60.482-60.844 60.509-60.872L61.757-62.089Q61.829-62.164 61.871-62.206Q61.914-62.249 61.993-62.328Q62.406-62.741 62.637-63.099Q62.868-63.456 62.868-63.880Q62.868-64.112 62.789-64.315Q62.710-64.519 62.569-64.669Q62.427-64.820 62.232-64.900Q62.037-64.980 61.805-64.980Q61.494-64.980 61.236-64.821Q60.978-64.662 60.848-64.385L60.868-64.385Q61.036-64.385 61.143-64.274Q61.251-64.163 61.251-63.999Q61.251-63.842 61.142-63.729Q61.032-63.616 60.868-63.616Q60.708-63.616 60.595-63.729Q60.482-63.842 60.482-63.999Q60.482-64.375 60.690-64.662Q60.899-64.949 61.234-65.105Q61.569-65.260 61.924-65.260Q62.348-65.260 62.728-65.102Q63.107-64.943 63.341-64.626Q63.575-64.310 63.575-63.880Q63.575-63.569 63.435-63.300Q63.295-63.032 63.090-62.827Q62.885-62.622 62.522-62.340Q62.160-62.058 62.051-61.962L61.196-61.234L61.839-61.234Q62.102-61.234 62.391-61.236Q62.680-61.237 62.898-61.246Q63.117-61.255 63.134-61.272Q63.196-61.337 63.233-61.504Q63.271-61.672 63.309-61.914L63.575-61.914",[955],[545,1016],{"fill":944,"d":1017},"m-32.023 9.57-6.563 13.127M-48.82 63.08c0-5.5-4.458-9.958-9.958-9.958s-9.959 4.459-9.959 9.959 4.459 9.958 9.959 9.958 9.958-4.459 9.958-9.958Zm-9.958 0",[938,1019,1020,1026],{"stroke":944},[938,1021,1023],{"transform":1022},"translate(-117.847 127.859)",[545,1024],{"d":953,"fill":940,"stroke":940,"className":1025,"style":956},[955],[938,1027,1028],{"transform":1022},[545,1029],{"d":1030,"fill":940,"stroke":940,"className":1031,"style":963},"M63.367-60.612L60.837-60.612L60.837-60.892Q61.805-60.892 61.805-61.101L61.805-64.720Q61.412-64.532 60.790-64.532L60.790-64.813Q61.207-64.813 61.571-64.914Q61.935-65.014 62.191-65.260L62.317-65.260Q62.382-65.243 62.399-65.175L62.399-61.101Q62.399-60.892 63.367-60.892",[955],[545,1033],{"fill":944,"d":1034},"m-47.672 40.868-6.563 13.127M-17.522 63.08c0-5.5-4.458-9.958-9.958-9.958s-9.959 4.459-9.959 9.959 4.459 9.958 9.959 9.958 9.958-4.459 9.958-9.958Zm-9.958 0",[938,1036,1037,1043],{"stroke":944},[938,1038,1040],{"transform":1039},"translate(-86.549 127.859)",[545,1041],{"d":953,"fill":940,"stroke":940,"className":1042,"style":956},[955],[938,1044,1045],{"transform":1039},[545,1046],{"d":1047,"fill":940,"stroke":940,"className":1048,"style":963},"M62.030-60.472Q61.395-60.472 61.031-60.817Q60.666-61.162 60.531-61.687Q60.396-62.212 60.396-62.837Q60.396-63.862 60.752-64.561Q61.107-65.260 62.030-65.260Q62.957-65.260 63.309-64.561Q63.661-63.862 63.661-62.837Q63.661-62.212 63.526-61.687Q63.391-61.162 63.028-60.817Q62.666-60.472 62.030-60.472M62.030-60.697Q62.468-60.697 62.681-61.072Q62.895-61.446 62.945-61.913Q62.994-62.379 62.994-62.957Q62.994-63.510 62.945-63.938Q62.895-64.365 62.683-64.700Q62.471-65.035 62.030-65.035Q61.688-65.035 61.485-64.828Q61.282-64.621 61.195-64.309Q61.107-63.996 61.085-63.680Q61.063-63.363 61.063-62.957Q61.063-62.540 61.085-62.198Q61.107-61.856 61.196-61.508Q61.285-61.159 61.490-60.928Q61.695-60.697 62.030-60.697",[955],[545,1050],{"fill":944,"d":1051},"m-38.587 40.868 6.564 13.127M-1.873 31.783c0-5.5-4.458-9.959-9.958-9.959s-9.959 4.459-9.959 9.959 4.459 9.958 9.959 9.958 9.958-4.459 9.958-9.958Zm-9.958 0",[938,1053,1054,1060],{"stroke":944},[938,1055,1057],{"transform":1056},"translate(-70.9 96.56)",[545,1058],{"d":953,"fill":940,"stroke":940,"className":1059,"style":956},[955],[938,1061,1062],{"transform":1056},[545,1063],{"d":1030,"fill":940,"stroke":940,"className":1064,"style":963},[955],[545,1066],{"fill":944,"d":1067},"m-22.938 9.57 6.564 13.127M36.538.484c0-5.5-4.458-9.958-9.958-9.958S16.622-5.015 16.622.484s4.458 9.959 9.958 9.959 9.958-4.459 9.958-9.959Zm-9.958 0",[938,1069,1070,1076],{"stroke":944},[938,1071,1073],{"transform":1072},"translate(-32.488 65.263)",[545,1074],{"d":953,"fill":940,"stroke":940,"className":1075,"style":956},[955],[938,1077,1078],{"transform":1072},[545,1079],{"d":1013,"fill":940,"stroke":940,"className":1080,"style":963},[955],[545,1082],{"fill":944,"d":1083},"M6.19-23.126 19.94-7.203M20.89 31.783c0-5.5-4.46-9.959-9.959-9.959-5.5 0-9.958 4.459-9.958 9.959S5.43 41.74 10.93 41.74s9.958-4.459 9.958-9.958Zm-9.959 0",[938,1085,1086,1092],{"stroke":944},[938,1087,1089],{"transform":1088},"translate(-48.137 96.56)",[545,1090],{"d":953,"fill":940,"stroke":940,"className":1091,"style":956},[955],[938,1093,1094],{"transform":1088},[545,1095],{"d":1030,"fill":940,"stroke":940,"className":1096,"style":963},[955],[545,1098],{"fill":944,"d":1099},"m22.037 9.57-6.563 13.127M52.187 31.783c0-5.5-4.458-9.959-9.958-9.959s-9.958 4.459-9.958 9.959 4.458 9.958 9.958 9.958 9.958-4.459 9.958-9.958Zm-9.958 0",[938,1101,1102,1108],{"stroke":944},[938,1103,1105],{"transform":1104},"translate(-16.84 96.56)",[545,1106],{"d":953,"fill":940,"stroke":940,"className":1107,"style":956},[955],[938,1109,1110],{"transform":1104},[545,1111],{"d":1047,"fill":940,"stroke":940,"className":1112,"style":963},[955],[545,1114],{"fill":944,"d":1115},"m31.123 9.57 6.563 13.127M117.629-30.814c0-5.5-4.459-9.958-9.959-9.958s-9.958 4.458-9.958 9.958 4.458 9.959 9.958 9.959 9.959-4.459 9.959-9.959Zm-9.959 0",[938,1117,1118,1124],{"stroke":944},[938,1119,1121],{"transform":1120},"translate(48.602 33.965)",[545,1122],{"d":953,"fill":940,"stroke":940,"className":1123,"style":956},[955],[938,1125,1126],{"transform":1120},[545,1127],{"d":996,"fill":940,"stroke":940,"className":1128,"style":963},[955],[545,1130],{"fill":944,"d":1131},"M62.401-57.022 98.88-35.903M90.599.484c0-5.5-4.459-9.958-9.959-9.958S70.682-5.015 70.682.484s4.458 9.959 9.958 9.959S90.6 5.984 90.6.484Zm-9.959 0",[938,1133,1134,1140],{"stroke":944},[938,1135,1137],{"transform":1136},"translate(21.572 65.263)",[545,1138],{"d":953,"fill":940,"stroke":940,"className":1139,"style":956},[955],[938,1141,1142],{"transform":1136},[545,1143],{"d":1013,"fill":940,"stroke":940,"className":1144,"style":963},[955],[545,1146],{"fill":944,"d":1147},"M101.03-23.126 87.28-7.203M74.95 31.783c0-5.5-4.459-9.959-9.959-9.959s-9.958 4.459-9.958 9.959 4.458 9.958 9.958 9.958 9.959-4.459 9.959-9.958Zm-9.959 0",[938,1149,1150,1156],{"stroke":944},[938,1151,1153],{"transform":1152},"translate(5.923 96.56)",[545,1154],{"d":953,"fill":940,"stroke":940,"className":1155,"style":956},[955],[938,1157,1158],{"transform":1152},[545,1159],{"d":1030,"fill":940,"stroke":940,"className":1160,"style":963},[955],[545,1162],{"fill":944,"d":1163},"m76.098 9.57-6.564 13.127M106.248 31.783c0-5.5-4.459-9.959-9.959-9.959s-9.958 4.459-9.958 9.959 4.458 9.958 9.958 9.958 9.959-4.459 9.959-9.958Zm-9.959 0",[938,1165,1166,1172],{"stroke":944},[938,1167,1169],{"transform":1168},"translate(37.22 96.56)",[545,1170],{"d":953,"fill":940,"stroke":940,"className":1171,"style":956},[955],[938,1173,1174],{"transform":1168},[545,1175],{"d":1047,"fill":940,"stroke":940,"className":1176,"style":963},[955],[545,1178],{"fill":944,"d":1179},"m85.183 9.57 6.564 13.127M144.659.484c0-5.5-4.459-9.958-9.959-9.958s-9.958 4.459-9.958 9.958 4.458 9.959 9.958 9.959 9.959-4.459 9.959-9.959Zm-9.959 0",[938,1181,1182,1188],{"stroke":944},[938,1183,1185],{"transform":1184},"translate(75.632 65.263)",[545,1186],{"d":953,"fill":940,"stroke":940,"className":1187,"style":956},[955],[938,1189,1190],{"transform":1184},[545,1191],{"d":1030,"fill":940,"stroke":940,"className":1192,"style":963},[955],[545,1194],{"fill":944,"d":1195},"m114.31-23.126 13.751 15.923",[1197,1198,1201,1202,1226],"figcaption",{"className":1199},[1200],"tikz-cap","Recursion tree for ",[421,1203,1205],{"className":1204},[428],[421,1206,1208],{"className":1207,"ariaHidden":433},[432],[421,1209,1211,1214,1217,1220,1223],{"className":1210},[437],[421,1212],{"className":1213,"style":442},[441],[421,1215,449],{"className":1216,"style":448},[446,447],[421,1218,454],{"className":1219},[453],[421,1221,921],{"className":1222},[446],[421,1224,463],{"className":1225},[462]," showing repeated subproblems recomputed many times.",[381,1228,1229,1230,1293,1294,1346,1347,1379,1380,1425,1426,1565,1566,1591,1592,1642],{},"The subtree rooted at ",[421,1231,1233],{"className":1232},[428],[421,1234,1236],{"className":1235,"ariaHidden":433},[432],[421,1237,1239,1243],{"className":1238},[437],[421,1240],{"className":1241,"style":1242},[441],"height:0.8333em;vertical-align:-0.15em;",[421,1244,1246,1249],{"className":1245},[446],[421,1247,449],{"className":1248,"style":448},[446,447],[421,1250,1253],{"className":1251},[1252],"msupsub",[421,1254,1256,1284],{"className":1255},[499,500],[421,1257,1259,1281],{"className":1258},[504],[421,1260,1263],{"className":1261,"style":1262},[508],"height:0.3011em;",[421,1264,1266,1270],{"style":1265},"top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;",[421,1267],{"className":1268,"style":1269},[516],"height:2.7em;",[421,1271,1277],{"className":1272},[1273,1274,1275,1276],"sizing","reset-size6","size3","mtight",[421,1278,1280],{"className":1279},[446,1276],"3",[421,1282,588],{"className":1283},[587],[421,1285,1287],{"className":1286},[504],[421,1288,1291],{"className":1289,"style":1290},[508],"height:0.15em;",[421,1292],{}," appears twice; ",[421,1295,1297],{"className":1296},[428],[421,1298,1300],{"className":1299,"ariaHidden":433},[432],[421,1301,1303,1306],{"className":1302},[437],[421,1304],{"className":1305,"style":1242},[441],[421,1307,1309,1312],{"className":1308},[446],[421,1310,449],{"className":1311,"style":448},[446,447],[421,1313,1315],{"className":1314},[1252],[421,1316,1318,1338],{"className":1317},[499,500],[421,1319,1321,1335],{"className":1320},[504],[421,1322,1324],{"className":1323,"style":1262},[508],[421,1325,1326,1329],{"style":1265},[421,1327],{"className":1328,"style":1269},[516],[421,1330,1332],{"className":1331},[1273,1274,1275,1276],[421,1333,712],{"className":1334},[446,1276],[421,1336,588],{"className":1337},[587],[421,1339,1341],{"className":1340},[504],[421,1342,1344],{"className":1343,"style":1290},[508],[421,1345],{}," appears three times; and the\nduplication compounds with depth. The number of leaves is itself ",[421,1348,1350],{"className":1349},[428],[421,1351,1353],{"className":1352,"ariaHidden":433},[432],[421,1354,1356,1359,1363,1366,1369,1372,1375],{"className":1355},[437],[421,1357],{"className":1358,"style":442},[441],[421,1360,1362],{"className":1361},[446],"Θ",[421,1364,454],{"className":1365},[453],[421,1367,449],{"className":1368,"style":448},[446,447],[421,1370,454],{"className":1371},[453],[421,1373,458],{"className":1374},[446,447],[421,1376,1378],{"className":1377},[462],"))",",\nand since the Fibonacci numbers grow like ",[421,1381,1383],{"className":1382},[428],[421,1384,1386],{"className":1385,"ariaHidden":433},[432],[421,1387,1389,1393],{"className":1388},[437],[421,1390],{"className":1391,"style":1392},[441],"height:0.8889em;vertical-align:-0.1944em;",[421,1394,1396,1400],{"className":1395},[446],[421,1397,1399],{"className":1398},[446,447],"ϕ",[421,1401,1403],{"className":1402},[1252],[421,1404,1406],{"className":1405},[499],[421,1407,1409],{"className":1408},[504],[421,1410,1413],{"className":1411,"style":1412},[508],"height:0.6644em;",[421,1414,1416,1419],{"style":1415},"top:-3.063em;margin-right:0.05em;",[421,1417],{"className":1418,"style":1269},[516],[421,1420,1422],{"className":1421},[1273,1274,1275,1276],[421,1423,458],{"className":1424},[446,447,1276]," (with ",[421,1427,1429],{"className":1428},[428],[421,1430,1432,1450,1471,1554],{"className":1431,"ariaHidden":433},[432],[421,1433,1435,1438,1441,1444,1447],{"className":1434},[437],[421,1436],{"className":1437,"style":1392},[441],[421,1439,1399],{"className":1440},[446,447],[421,1442],{"className":1443,"style":468},[467],[421,1445,473],{"className":1446},[472],[421,1448],{"className":1449,"style":468},[467],[421,1451,1453,1456,1459,1462,1465,1468],{"className":1452},[437],[421,1454],{"className":1455,"style":442},[441],[421,1457,454],{"className":1458},[453],[421,1460,403],{"className":1461},[446],[421,1463],{"className":1464,"style":666},[467],[421,1466,687],{"className":1467},[670],[421,1469],{"className":1470,"style":666},[467],[421,1472,1474,1478,1537,1540,1544,1547,1551],{"className":1473},[437],[421,1475],{"className":1476,"style":1477},[441],"height:1.1572em;vertical-align:-0.25em;",[421,1479,1482],{"className":1480},[446,1481],"sqrt",[421,1483,1485,1528],{"className":1484},[499,500],[421,1486,1488,1525],{"className":1487},[504],[421,1489,1492,1505],{"className":1490,"style":1491},[508],"height:0.9072em;",[421,1493,1497,1501],{"className":1494,"style":1496},[1495],"svg-align","top:-3em;",[421,1498],{"className":1499,"style":1500},[516],"height:3em;",[421,1502,921],{"className":1503,"style":1504},[446],"padding-left:0.833em;",[421,1506,1508,1511],{"style":1507},"top:-2.8672em;",[421,1509],{"className":1510,"style":1500},[516],[421,1512,1516],{"className":1513,"style":1515},[1514],"hide-tail","min-width:0.853em;height:1.08em;",[536,1517,1522],{"xmlns":538,"width":1518,"height":1519,"viewBox":1520,"preserveAspectRatio":1521},"400em","1.08em","0 0 400000 1080","xMinYMin slice",[545,1523],{"d":1524},"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z",[421,1526,588],{"className":1527},[587],[421,1529,1531],{"className":1530},[504],[421,1532,1535],{"className":1533,"style":1534},[508],"height:0.1328em;",[421,1536],{},[421,1538,463],{"className":1539},[462],[421,1541,1543],{"className":1542},[446],"\u002F2",[421,1545],{"className":1546,"style":468},[467],[421,1548,1550],{"className":1549},[472],"≈",[421,1552],{"className":1553,"style":468},[467],[421,1555,1557,1561],{"className":1556},[437],[421,1558],{"className":1559,"style":1560},[441],"height:0.6444em;",[421,1562,1564],{"className":1563},[446],"1.618"," the golden ratio), ",[421,1567,1569],{"className":1568},[428],[421,1570,1572],{"className":1571,"ariaHidden":433},[432],[421,1573,1575,1579],{"className":1574},[437],[421,1576],{"className":1577,"style":1578},[441],"height:0.6944em;",[421,1580,1584],{"className":1581},[1582,1583],"enclosing","textsc",[421,1585,1587],{"className":1586},[446,756],[421,1588,1590],{"className":1589},[446],"Rec-Fib"," runs in ",[421,1593,1595],{"className":1594},[428],[421,1596,1598],{"className":1597,"ariaHidden":433},[432],[421,1599,1601,1604,1607,1610,1639],{"className":1600},[437],[421,1602],{"className":1603,"style":442},[441],[421,1605,1362],{"className":1606},[446],[421,1608,454],{"className":1609},[453],[421,1611,1613,1616],{"className":1612},[446],[421,1614,1399],{"className":1615},[446,447],[421,1617,1619],{"className":1618},[1252],[421,1620,1622],{"className":1621},[499],[421,1623,1625],{"className":1624},[504],[421,1626,1628],{"className":1627,"style":1412},[508],[421,1629,1630,1633],{"style":1415},[421,1631],{"className":1632,"style":1269},[516],[421,1634,1636],{"className":1635},[1273,1274,1275,1276],[421,1637,458],{"className":1638},[446,447,1276],[421,1640,463],{"className":1641},[462]," time:\nexponential, to compute a quantity we could write down in a fraction of a second.",[381,1644,1645,1646,1680,1681,1684,1685,1759],{},"The diagnosis is precise: there are only ",[421,1647,1649],{"className":1648},[428],[421,1650,1652,1671],{"className":1651,"ariaHidden":433},[432],[421,1653,1655,1659,1662,1665,1668],{"className":1654},[437],[421,1656],{"className":1657,"style":1658},[441],"height:0.6667em;vertical-align:-0.0833em;",[421,1660,458],{"className":1661},[446,447],[421,1663],{"className":1664,"style":666},[467],[421,1666,687],{"className":1667},[670],[421,1669],{"className":1670,"style":666},[467],[421,1672,1674,1677],{"className":1673},[437],[421,1675],{"className":1676,"style":1560},[441],[421,1678,403],{"className":1679},[446]," ",[389,1682,1683],{},"distinct"," subproblems,\n",[421,1686,1688],{"className":1687},[428],[421,1689,1691],{"className":1690,"ariaHidden":433},[432],[421,1692,1694,1697,1700,1703,1706,1709,1712,1716,1719,1722,1725,1728,1731,1734,1738,1741,1744,1747,1750,1753,1756],{"className":1693},[437],[421,1695],{"className":1696,"style":442},[441],[421,1698,449],{"className":1699,"style":448},[446,447],[421,1701,454],{"className":1702},[453],[421,1704,632],{"className":1705},[446],[421,1707,463],{"className":1708},[462],[421,1710,780],{"className":1711},[779],[421,1713],{"className":1714,"style":1715},[467],"margin-right:0.1667em;",[421,1717,449],{"className":1718,"style":448},[446,447],[421,1720,454],{"className":1721},[453],[421,1723,403],{"className":1724},[446],[421,1726,463],{"className":1727},[462],[421,1729,780],{"className":1730},[779],[421,1732],{"className":1733,"style":1715},[467],[421,1735,1737],{"className":1736},[487],"…",[421,1739],{"className":1740,"style":1715},[467],[421,1742,780],{"className":1743},[779],[421,1745],{"className":1746,"style":1715},[467],[421,1748,449],{"className":1749,"style":448},[446,447],[421,1751,454],{"className":1752},[453],[421,1754,458],{"className":1755},[446,447],[421,1757,463],{"className":1758},[462],", but the recursion visits them exponentially often.",[413,1761,1763],{"id":1762},"the-first-cure-memoization-top-down","The first cure: memoization (top-down)",[381,1765,1766,1767,1770],{},"The minimal fix keeps the recursive structure but adds a ",[384,1768,1769],{},"memo",", a table that\nremembers each answer the first time we compute it. Before recursing, we check\nthe table; if the answer is there, we return it immediately.",[863,1772,1774],{"className":865,"code":1773,"language":867,"meta":376,"style":376},"caption: $\\textsc{Memo-Fib}(n)$ — top-down with a memo table $M[0..n]$\nnumber: 2\nif $M[n]$ is defined then\n  return $M[n]$ \u002F\u002F already solved\nif $n \u003C 2$ then\n  $M[n] \\gets n$\nelse\n  $M[n] \\gets$ $\\textsc{Memo-Fib}(n-1)$ **+** $\\textsc{Memo-Fib}(n-2)$\nreturn $M[n]$\n",[869,1775,1776,1781,1786,1791,1796,1800,1805,1810,1815],{"__ignoreMap":376},[421,1777,1778],{"class":873,"line":6},[421,1779,1780],{},"caption: $\\textsc{Memo-Fib}(n)$ — top-down with a memo table $M[0..n]$\n",[421,1782,1783],{"class":873,"line":18},[421,1784,1785],{},"number: 2\n",[421,1787,1788],{"class":873,"line":24},[421,1789,1790],{},"if $M[n]$ is defined then\n",[421,1792,1793],{"class":873,"line":73},[421,1794,1795],{},"  return $M[n]$ \u002F\u002F already solved\n",[421,1797,1798],{"class":873,"line":102},[421,1799,886],{},[421,1801,1802],{"class":873,"line":108},[421,1803,1804],{},"  $M[n] \\gets n$\n",[421,1806,1807],{"class":873,"line":116},[421,1808,1809],{},"else\n",[421,1811,1812],{"class":873,"line":196},[421,1813,1814],{},"  $M[n] \\gets$ $\\textsc{Memo-Fib}(n-1)$ **+** $\\textsc{Memo-Fib}(n-2)$\n",[421,1816,1817],{"class":873,"line":202},[421,1818,1819],{},"return $M[n]$\n",[381,1821,1822,1823,1856,1857,1881,1882,1885,1886,1889,1890,1892,1893,1896,1897,1900,1901],{},"Now each of the ",[421,1824,1826],{"className":1825},[428],[421,1827,1829,1847],{"className":1828,"ariaHidden":433},[432],[421,1830,1832,1835,1838,1841,1844],{"className":1831},[437],[421,1833],{"className":1834,"style":1658},[441],[421,1836,458],{"className":1837},[446,447],[421,1839],{"className":1840,"style":666},[467],[421,1842,687],{"className":1843},[670],[421,1845],{"className":1846,"style":666},[467],[421,1848,1850,1853],{"className":1849},[437],[421,1851],{"className":1852,"style":1560},[441],[421,1854,403],{"className":1855},[446]," subproblems is solved once; every later request for it is\na single table lookup. The running time drops from exponential to ",[421,1858,1860],{"className":1859},[428],[421,1861,1863],{"className":1862,"ariaHidden":433},[432],[421,1864,1866,1869,1872,1875,1878],{"className":1865},[437],[421,1867],{"className":1868,"style":442},[441],[421,1870,1362],{"className":1871},[446],[421,1873,454],{"className":1874},[453],[421,1876,458],{"className":1877},[446,447],[421,1879,463],{"className":1880},[462],".\nThis style, recurse as before but ",[384,1883,1884],{},"cache"," results, is called\n",[384,1887,1888],{},"memoization"," (note: ",[389,1891,1769],{},"-ization, not ",[389,1894,1895],{},"memorization","). It is the ",[384,1898,1899],{},"top-down","\nform of dynamic programming, and it is often the easiest to write, because it is\njust the natural recursion plus a guard.",[394,1902,1903],{},[397,1904,712],{"href":1905,"ariaDescribedBy":1906,"dataFootnoteRef":376,"id":1907},"#user-content-fn-skiena-dp",[401],"user-content-fnref-skiena-dp",[381,1909,1910,1911,1944],{},"Compare the recursion tree now against the naive one above: every repeated\nsubproblem becomes a cache hit that returns at once, so the exponential tree\ncollapses to a thin spine of ",[421,1912,1914],{"className":1913},[428],[421,1915,1917,1935],{"className":1916,"ariaHidden":433},[432],[421,1918,1920,1923,1926,1929,1932],{"className":1919},[437],[421,1921],{"className":1922,"style":1658},[441],[421,1924,458],{"className":1925},[446,447],[421,1927],{"className":1928,"style":666},[467],[421,1930,687],{"className":1931},[670],[421,1933],{"className":1934,"style":666},[467],[421,1936,1938,1941],{"className":1937},[437],[421,1939],{"className":1940,"style":1560},[441],[421,1942,403],{"className":1943},[446]," first-time computations.",[927,1946,1948,2120],{"className":1947},[930,931],[536,1949,1952],{"xmlns":538,"width":1950,"height":935,"viewBox":1951},"261.465","-75 -75 196.099 151.509",[938,1953,1954,1956,1973,1975,1989,1991,2005,2007,2021,2023,2037,2039,2053,2056,2075,2078,2096,2099,2117],{"stroke":940,"style":941},[545,1955],{"fill":944,"d":945},[938,1957,1958,1966],{"stroke":944},[938,1959,1961],{"transform":1960},"translate(-5.036 2.575)",[545,1962],{"d":1963,"fill":940,"stroke":940,"className":1964,"style":1965},"M56.717-62.112L54.076-62.112Q53.979-62.112 53.979-62.231Q53.979-62.292 54.012-62.360Q54.045-62.428 54.107-62.428Q54.608-62.428 54.836-62.481Q54.955-62.525 55.034-62.758L56.256-67.675Q56.273-67.763 56.273-67.807Q56.273-67.873 56.247-67.891Q56.075-67.944 55.544-67.944Q55.438-67.944 55.438-68.062Q55.438-68.124 55.471-68.192Q55.504-68.260 55.561-68.260L60.404-68.260Q60.452-68.260 60.483-68.225Q60.514-68.190 60.514-68.141L60.307-66.304Q60.298-66.260 60.270-66.230Q60.241-66.199 60.197-66.199L60.118-66.199Q60.017-66.199 60.017-66.322Q60.061-66.871 60.061-66.981Q60.061-67.429 59.861-67.640Q59.661-67.851 59.360-67.897Q59.059-67.944 58.532-67.944L57.526-67.944Q57.266-67.944 57.192-67.897Q57.117-67.851 57.055-67.610L56.488-65.342L57.183-65.342Q57.649-65.342 57.879-65.406Q58.110-65.469 58.246-65.680Q58.382-65.891 58.488-66.313Q58.519-66.397 58.589-66.397L58.668-66.397Q58.712-66.397 58.745-66.364Q58.778-66.331 58.778-66.287Q58.778-66.269 58.769-66.252L58.220-64.054Q58.202-63.975 58.119-63.975L58.040-63.975Q57.939-63.975 57.939-64.094Q57.939-64.142 57.985-64.327Q58.031-64.511 58.031-64.630Q58.031-64.889 57.791-64.960Q57.552-65.030 57.165-65.030L56.409-65.030L55.825-62.670Q55.825-62.653 55.823-62.637Q55.820-62.622 55.816-62.600Q55.816-62.503 55.886-62.481Q56.137-62.428 56.770-62.428Q56.818-62.428 56.847-62.395Q56.875-62.362 56.875-62.319Q56.875-62.112 56.717-62.112",[955],"stroke-width:0.270",[938,1967,1968],{"transform":1960},[545,1969],{"d":1970,"fill":940,"stroke":940,"className":1971,"style":1972},"M60.272-61.754Q60.348-61.587 60.496-61.468Q60.644-61.349 60.833-61.288Q61.022-61.226 61.209-61.226Q61.526-61.226 61.729-61.368Q61.933-61.510 62.027-61.757Q62.120-62.003 62.120-62.313Q62.120-62.767 61.973-63.088Q61.825-63.409 61.423-63.409Q61.174-63.409 61.006-63.347Q60.837-63.286 60.732-63.201Q60.626-63.116 60.550-63.032Q60.474-62.949 60.439-62.943L60.374-62.943Q60.345-62.943 60.317-62.974Q60.289-63.005 60.289-63.031L60.289-65.029Q60.298-65.102 60.374-65.102Q60.380-65.102 60.404-65.096Q60.893-64.909 61.376-64.909Q61.866-64.909 62.355-65.096Q62.378-65.102 62.384-65.102Q62.449-65.102 62.469-65.029L62.469-64.965Q62.466-64.941 62.449-64.915Q62.188-64.642 61.849-64.491Q61.511-64.341 61.148-64.341Q60.826-64.341 60.547-64.417L60.547-63.333Q60.720-63.482 60.946-63.554Q61.171-63.626 61.423-63.626Q61.784-63.626 62.087-63.448Q62.390-63.271 62.567-62.971Q62.745-62.671 62.745-62.313Q62.745-61.929 62.522-61.623Q62.299-61.317 61.945-61.152Q61.590-60.986 61.209-60.986Q60.899-60.986 60.604-61.121Q60.310-61.256 60.128-61.505Q59.947-61.754 59.947-62.079Q59.947-62.214 60.037-62.304Q60.128-62.395 60.266-62.395Q60.401-62.395 60.496-62.304Q60.591-62.214 60.591-62.079Q60.591-61.941 60.500-61.847Q60.410-61.754 60.272-61.754",[955],"stroke-width:0.180",[545,1974],{"fill":944,"d":966},[938,1976,1977,1983],{"stroke":944},[938,1978,1980],{"transform":1979},"translate(-59.097 33.873)",[545,1981],{"d":1963,"fill":940,"stroke":940,"className":1982,"style":1965},[955],[938,1984,1985],{"transform":1979},[545,1986],{"d":1987,"fill":940,"stroke":940,"className":1988,"style":1972},"M61.646-62.091L59.791-62.091L59.791-62.348L61.886-65.055Q61.924-65.102 61.983-65.102L62.115-65.102Q62.156-65.102 62.183-65.074Q62.211-65.047 62.211-65.006L62.211-62.348L62.900-62.348L62.900-62.091L62.211-62.091L62.211-61.543Q62.211-61.370 62.888-61.370L62.888-61.112L60.969-61.112L60.969-61.370Q61.646-61.370 61.646-61.543L61.646-62.091M61.687-64.431L60.081-62.348L61.687-62.348",[955],[545,1990],{"fill":944,"d":983},[938,1992,1993,1999],{"stroke":944},[938,1994,1996],{"transform":1995},"translate(-86.127 65.171)",[545,1997],{"d":1963,"fill":940,"stroke":940,"className":1998,"style":1965},[955],[938,2000,2001],{"transform":1995},[545,2002],{"d":2003,"fill":940,"stroke":940,"className":2004,"style":1972},"M60.289-61.563Q60.585-61.226 61.315-61.226Q61.573-61.226 61.753-61.354Q61.933-61.481 62.021-61.689Q62.109-61.897 62.109-62.155Q62.109-62.550 61.902-62.821Q61.696-63.092 61.309-63.092L60.843-63.092Q60.779-63.107 60.764-63.169L60.764-63.236Q60.779-63.292 60.843-63.309L61.245-63.333Q61.455-63.333 61.624-63.475Q61.792-63.617 61.885-63.831Q61.977-64.045 61.977-64.261Q61.977-64.549 61.792-64.714Q61.608-64.880 61.315-64.880Q61.054-64.880 60.830-64.812Q60.606-64.745 60.459-64.587Q60.588-64.569 60.667-64.480Q60.746-64.390 60.746-64.261Q60.746-64.124 60.651-64.029Q60.556-63.933 60.415-63.933Q60.281-63.933 60.184-64.030Q60.087-64.127 60.087-64.261Q60.087-64.549 60.278-64.740Q60.468-64.932 60.749-65.017Q61.031-65.102 61.315-65.102Q61.590-65.102 61.891-65.011Q62.191-64.921 62.399-64.732Q62.607-64.543 62.607-64.261Q62.607-63.892 62.361-63.620Q62.115-63.347 61.743-63.218Q62.162-63.125 62.479-62.842Q62.797-62.559 62.797-62.161Q62.797-61.798 62.578-61.532Q62.358-61.267 62.012-61.127Q61.666-60.986 61.315-60.986Q61.092-60.986 60.845-61.034Q60.597-61.083 60.377-61.193Q60.158-61.302 60.026-61.481Q59.894-61.660 59.894-61.915Q59.894-62.064 59.996-62.167Q60.099-62.269 60.248-62.269Q60.398-62.269 60.500-62.167Q60.603-62.064 60.603-61.915Q60.603-61.783 60.514-61.682Q60.424-61.581 60.289-61.563",[955],[545,2006],{"fill":944,"d":1000},[938,2008,2009,2015],{"stroke":944},[938,2010,2012],{"transform":2011},"translate(-101.776 96.47)",[545,2013],{"d":1963,"fill":940,"stroke":940,"className":2014,"style":1965},[955],[938,2016,2017],{"transform":2011},[545,2018],{"d":2019,"fill":940,"stroke":940,"className":2020,"style":1972},"M62.557-61.112L59.947-61.112L59.947-61.297Q59.953-61.320 59.973-61.346L61.124-62.401Q61.464-62.712 61.644-62.898Q61.825-63.084 61.970-63.344Q62.115-63.605 62.115-63.901Q62.115-64.174 61.989-64.389Q61.863-64.604 61.643-64.724Q61.423-64.844 61.148-64.844Q60.972-64.844 60.802-64.787Q60.632-64.730 60.500-64.623Q60.369-64.516 60.289-64.358Q60.377-64.358 60.455-64.314Q60.533-64.270 60.577-64.194Q60.620-64.118 60.620-64.021Q60.620-63.881 60.524-63.784Q60.427-63.687 60.284-63.687Q60.146-63.687 60.046-63.787Q59.947-63.886 59.947-64.021Q59.947-64.346 60.137-64.594Q60.328-64.841 60.631-64.972Q60.934-65.102 61.250-65.102Q61.631-65.102 61.974-64.967Q62.317-64.833 62.531-64.560Q62.745-64.288 62.745-63.901Q62.745-63.626 62.620-63.399Q62.495-63.172 62.315-63Q62.135-62.829 61.810-62.589Q61.485-62.348 61.400-62.281L60.644-61.677L61.177-61.677Q61.666-61.677 61.997-61.685Q62.328-61.692 62.343-61.707Q62.402-61.777 62.434-61.912Q62.466-62.047 62.498-62.258L62.745-62.258",[955],[545,2022],{"fill":944,"d":1017},[938,2024,2025,2031],{"stroke":944},[938,2026,2028],{"transform":2027},"translate(-117.425 127.767)",[545,2029],{"d":1963,"fill":940,"stroke":940,"className":2030,"style":1965},[955],[938,2032,2033],{"transform":2027},[545,2034],{"d":2035,"fill":940,"stroke":940,"className":2036,"style":1972},"M62.557-61.112L60.266-61.112L60.266-61.370Q61.142-61.370 61.142-61.543L61.142-64.622Q60.949-64.534 60.717-64.497Q60.486-64.461 60.231-64.461L60.231-64.718Q60.609-64.718 60.930-64.803Q61.250-64.888 61.479-65.102L61.599-65.102Q61.631-65.102 61.656-65.079Q61.681-65.055 61.681-65.017L61.681-61.543Q61.681-61.370 62.557-61.370",[955],[545,2038],{"fill":944,"d":1034},[938,2040,2041,2047],{"stroke":944},[938,2042,2044],{"transform":2043},"translate(-86.127 127.767)",[545,2045],{"d":1963,"fill":940,"stroke":940,"className":2046,"style":1965},[955],[938,2048,2049],{"transform":2043},[545,2050],{"d":2051,"fill":940,"stroke":940,"className":2052,"style":1972},"M61.347-60.986Q60.785-60.986 60.455-61.273Q60.125-61.560 59.998-62.010Q59.870-62.460 59.870-63.025Q59.870-63.429 59.936-63.794Q60.002-64.159 60.165-64.455Q60.328-64.751 60.619-64.926Q60.911-65.102 61.347-65.102Q61.784-65.102 62.074-64.926Q62.364-64.751 62.528-64.456Q62.692-64.162 62.756-63.804Q62.821-63.447 62.821-63.025Q62.821-62.460 62.693-62.010Q62.566-61.560 62.239-61.273Q61.912-60.986 61.347-60.986M61.347-61.203Q61.751-61.203 61.946-61.513Q62.141-61.824 62.185-62.216Q62.229-62.609 62.229-63.122Q62.229-63.617 62.185-63.976Q62.141-64.335 61.946-64.610Q61.751-64.885 61.347-64.885Q60.943-64.885 60.748-64.610Q60.553-64.335 60.509-63.976Q60.465-63.617 60.465-63.122Q60.465-62.609 60.509-62.216Q60.553-61.824 60.748-61.513Q60.943-61.203 61.347-61.203",[955],[545,2054],{"fill":944,"d":2055},"m-38.587 40.868 6.564 13.127",[938,2057,2059,2062],{"fill":2058},"var(--tk-soft-neutral)",[545,2060],{"d":2061},"M-1.873 31.783c0-5.5-4.458-9.959-9.958-9.959s-9.959 4.459-9.959 9.959 4.459 9.958 9.959 9.958 9.958-4.459 9.958-9.958Zm-9.958 0",[938,2063,2064,2070],{"fill":940,"stroke":944},[938,2065,2067],{"transform":2066},"translate(-70.478 96.47)",[545,2068],{"d":1963,"fill":940,"stroke":940,"className":2069,"style":1965},[955],[938,2071,2072],{"transform":2066},[545,2073],{"d":2035,"fill":940,"stroke":940,"className":2074,"style":1972},[955],[545,2076],{"fill":944,"d":2077},"m-22.938 9.57 6.564 13.127",[938,2079,2080,2083],{"fill":2058},[545,2081],{"d":2082},"M36.538.484c0-5.5-4.458-9.958-9.958-9.958S16.622-5.015 16.622.484s4.458 9.959 9.958 9.959 9.958-4.459 9.958-9.959Zm-9.958 0",[938,2084,2085,2091],{"fill":940,"stroke":944},[938,2086,2088],{"transform":2087},"translate(-32.066 65.171)",[545,2089],{"d":1963,"fill":940,"stroke":940,"className":2090,"style":1965},[955],[938,2092,2093],{"transform":2087},[545,2094],{"d":2019,"fill":940,"stroke":940,"className":2095,"style":1972},[955],[545,2097],{"fill":944,"d":2098},"M6.19-23.126 19.94-7.203",[938,2100,2101,2104],{"fill":2058},[545,2102],{"d":2103},"M117.629-30.814c0-5.5-4.459-9.958-9.959-9.958s-9.958 4.458-9.958 9.958 4.458 9.959 9.958 9.959 9.959-4.459 9.959-9.959Zm-9.959 0",[938,2105,2106,2112],{"fill":940,"stroke":944},[938,2107,2109],{"transform":2108},"translate(49.024 33.873)",[545,2110],{"d":1963,"fill":940,"stroke":940,"className":2111,"style":1965},[955],[938,2113,2114],{"transform":2108},[545,2115],{"d":2003,"fill":940,"stroke":940,"className":2116,"style":1972},[955],[545,2118],{"fill":944,"d":2119},"M62.401-57.022 98.88-35.903",[1197,2121,2123,2124,2148],{"className":2122},[1200],"Memoized ",[421,2125,2127],{"className":2126},[428],[421,2128,2130],{"className":2129,"ariaHidden":433},[432],[421,2131,2133,2136,2139,2142,2145],{"className":2132},[437],[421,2134],{"className":2135,"style":442},[441],[421,2137,449],{"className":2138,"style":448},[446,447],[421,2140,454],{"className":2141},[453],[421,2143,921],{"className":2144},[446],[421,2146,463],{"className":2147},[462],": each distinct subproblem is computed once (solid); later requests are cache hits (grey) that return immediately, pruning the repeated subtrees.",[381,2150,2151,2152,2204,2205,2204,2257,2309,2310,2421],{},"The greyed nodes (",[421,2153,2155],{"className":2154},[428],[421,2156,2158],{"className":2157,"ariaHidden":433},[432],[421,2159,2161,2164],{"className":2160},[437],[421,2162],{"className":2163,"style":1242},[441],[421,2165,2167,2170],{"className":2166},[446],[421,2168,449],{"className":2169,"style":448},[446,447],[421,2171,2173],{"className":2172},[1252],[421,2174,2176,2196],{"className":2175},[499,500],[421,2177,2179,2193],{"className":2178},[504],[421,2180,2182],{"className":2181,"style":1262},[508],[421,2183,2184,2187],{"style":1265},[421,2185],{"className":2186,"style":1269},[516],[421,2188,2190],{"className":2189},[1273,1274,1275,1276],[421,2191,1280],{"className":2192},[446,1276],[421,2194,588],{"className":2195},[587],[421,2197,2199],{"className":2198},[504],[421,2200,2202],{"className":2201,"style":1290},[508],[421,2203],{},", ",[421,2206,2208],{"className":2207},[428],[421,2209,2211],{"className":2210,"ariaHidden":433},[432],[421,2212,2214,2217],{"className":2213},[437],[421,2215],{"className":2216,"style":1242},[441],[421,2218,2220,2223],{"className":2219},[446],[421,2221,449],{"className":2222,"style":448},[446,447],[421,2224,2226],{"className":2225},[1252],[421,2227,2229,2249],{"className":2228},[499,500],[421,2230,2232,2246],{"className":2231},[504],[421,2233,2235],{"className":2234,"style":1262},[508],[421,2236,2237,2240],{"style":1265},[421,2238],{"className":2239,"style":1269},[516],[421,2241,2243],{"className":2242},[1273,1274,1275,1276],[421,2244,712],{"className":2245},[446,1276],[421,2247,588],{"className":2248},[587],[421,2250,2252],{"className":2251},[504],[421,2253,2255],{"className":2254,"style":1290},[508],[421,2256],{},[421,2258,2260],{"className":2259},[428],[421,2261,2263],{"className":2262,"ariaHidden":433},[432],[421,2264,2266,2269],{"className":2265},[437],[421,2267],{"className":2268,"style":1242},[441],[421,2270,2272,2275],{"className":2271},[446],[421,2273,449],{"className":2274,"style":448},[446,447],[421,2276,2278],{"className":2277},[1252],[421,2279,2281,2301],{"className":2280},[499,500],[421,2282,2284,2298],{"className":2283},[504],[421,2285,2287],{"className":2286,"style":1262},[508],[421,2288,2289,2292],{"style":1265},[421,2290],{"className":2291,"style":1269},[516],[421,2293,2295],{"className":2294},[1273,1274,1275,1276],[421,2296,403],{"className":2297},[446,1276],[421,2299,588],{"className":2300},[587],[421,2302,2304],{"className":2303},[504],[421,2305,2307],{"className":2306,"style":1290},[508],[421,2308],{},") are the duplicates from the naive tree;\nhere they resolve in a single lookup, so the whole computation touches each of\n",[421,2311,2313],{"className":2312},[428],[421,2314,2316],{"className":2315,"ariaHidden":433},[432],[421,2317,2319,2323,2363,2366,2369,2372,2375,2378,2381],{"className":2318},[437],[421,2320],{"className":2321,"style":2322},[441],"height:0.8778em;vertical-align:-0.1944em;",[421,2324,2326,2329],{"className":2325},[446],[421,2327,449],{"className":2328,"style":448},[446,447],[421,2330,2332],{"className":2331},[1252],[421,2333,2335,2355],{"className":2334},[499,500],[421,2336,2338,2352],{"className":2337},[504],[421,2339,2341],{"className":2340,"style":1262},[508],[421,2342,2343,2346],{"style":1265},[421,2344],{"className":2345,"style":1269},[516],[421,2347,2349],{"className":2348},[1273,1274,1275,1276],[421,2350,632],{"className":2351},[446,1276],[421,2353,588],{"className":2354},[587],[421,2356,2358],{"className":2357},[504],[421,2359,2361],{"className":2360,"style":1290},[508],[421,2362],{},[421,2364,780],{"className":2365},[779],[421,2367],{"className":2368,"style":1715},[467],[421,2370,1737],{"className":2371},[487],[421,2373],{"className":2374,"style":1715},[467],[421,2376,780],{"className":2377},[779],[421,2379],{"className":2380,"style":1715},[467],[421,2382,2384,2387],{"className":2383},[446],[421,2385,449],{"className":2386,"style":448},[446,447],[421,2388,2390],{"className":2389},[1252],[421,2391,2393,2413],{"className":2392},[499,500],[421,2394,2396,2410],{"className":2395},[504],[421,2397,2399],{"className":2398,"style":1262},[508],[421,2400,2401,2404],{"style":1265},[421,2402],{"className":2403,"style":1269},[516],[421,2405,2407],{"className":2406},[1273,1274,1275,1276],[421,2408,921],{"className":2409},[446,1276],[421,2411,588],{"className":2412},[587],[421,2414,2416],{"className":2415},[504],[421,2417,2419],{"className":2418,"style":1290},[508],[421,2420],{}," exactly once.",[413,2423,2425],{"id":2424},"the-second-cure-tabulation-bottom-up","The second cure: tabulation (bottom-up)",[381,2427,2428,2429,2432,2433,2436,2437,2440,2441,2444],{},"If we know in advance ",[389,2430,2431],{},"which"," subproblems we need and in ",[389,2434,2435],{},"what order"," their\ndependencies resolve, we can drop the recursion entirely and fill the table\ndirectly with a loop. This is ",[384,2438,2439],{},"tabulation",", the ",[384,2442,2443],{},"bottom-up"," form.",[863,2446,2448],{"className":865,"code":2447,"language":867,"meta":376,"style":376},"caption: $\\textsc{Tab-Fib}(n)$ — bottom-up over a table $F[0..n]$\nnumber: 3\n$F[0] \\gets 0$\n$F[1] \\gets 1$\nfor $i \\gets 2$ to $n$ do\n  $F[i] \\gets F[i-1] + F[i-2]$\nreturn $F[n]$\n",[869,2449,2450,2455,2460,2465,2470,2475,2480],{"__ignoreMap":376},[421,2451,2452],{"class":873,"line":6},[421,2453,2454],{},"caption: $\\textsc{Tab-Fib}(n)$ — bottom-up over a table $F[0..n]$\n",[421,2456,2457],{"class":873,"line":18},[421,2458,2459],{},"number: 3\n",[421,2461,2462],{"class":873,"line":24},[421,2463,2464],{},"$F[0] \\gets 0$\n",[421,2466,2467],{"class":873,"line":73},[421,2468,2469],{},"$F[1] \\gets 1$\n",[421,2471,2472],{"class":873,"line":102},[421,2473,2474],{},"for $i \\gets 2$ to $n$ do\n",[421,2476,2477],{"class":873,"line":108},[421,2478,2479],{},"  $F[i] \\gets F[i-1] + F[i-2]$\n",[421,2481,2482],{"class":873,"line":116},[421,2483,2484],{},"return $F[n]$\n",[381,2486,2487,2488,2543],{},"The loop visits subproblems in an order, ",[421,2489,2491],{"className":2490},[428],[421,2492,2494],{"className":2493,"ariaHidden":433},[432],[421,2495,2497,2501,2504,2507,2510,2513,2516,2519,2522,2525,2528,2531,2534,2537,2540],{"className":2496},[437],[421,2498],{"className":2499,"style":2500},[441],"height:0.8389em;vertical-align:-0.1944em;",[421,2502,632],{"className":2503},[446],[421,2505,780],{"className":2506},[779],[421,2508],{"className":2509,"style":1715},[467],[421,2511,403],{"className":2512},[446],[421,2514,780],{"className":2515},[779],[421,2517],{"className":2518,"style":1715},[467],[421,2520,712],{"className":2521},[446],[421,2523,780],{"className":2524},[779],[421,2526],{"className":2527,"style":1715},[467],[421,2529,1737],{"className":2530},[487],[421,2532],{"className":2533,"style":1715},[467],[421,2535,780],{"className":2536},[779],[421,2538],{"className":2539,"style":1715},[467],[421,2541,458],{"className":2542},[446,447],", that guarantees\nevery dependency is ready before it is needed. No recursion, no memo-check\noverhead, no risk of stack overflow.",[381,2545,2546,2547,2550,2551,2604],{},"The two cures fill the ",[389,2548,2549],{},"same"," array; they differ only in the order they visit\nits cells. Bottom-up sweeps the indices forward; top-down dives to ",[421,2552,2554],{"className":2553},[428],[421,2555,2557],{"className":2556,"ariaHidden":433},[432],[421,2558,2560,2563],{"className":2559},[437],[421,2561],{"className":2562,"style":1242},[441],[421,2564,2566,2569],{"className":2565},[446],[421,2567,449],{"className":2568,"style":448},[446,447],[421,2570,2572],{"className":2571},[1252],[421,2573,2575,2596],{"className":2574},[499,500],[421,2576,2578,2593],{"className":2577},[504],[421,2579,2582],{"className":2580,"style":2581},[508],"height:0.1514em;",[421,2583,2584,2587],{"style":1265},[421,2585],{"className":2586,"style":1269},[516],[421,2588,2590],{"className":2589},[1273,1274,1275,1276],[421,2591,458],{"className":2592},[446,447,1276],[421,2594,588],{"className":2595},[587],[421,2597,2599],{"className":2598},[504],[421,2600,2602],{"className":2601,"style":1290},[508],[421,2603],{}," first\nand writes each cell as the recursion unwinds.",[927,2606,2608,2893],{"className":2607},[930,931],[536,2609,2613],{"xmlns":538,"width":2610,"height":2611,"viewBox":2612},"323.197","165.287","-75 -75 242.398 123.965",[938,2614,2615,2633,2636,2643,2646,2653,2656,2662,2665,2672,2675,2682,2685,2692,2699,2706,2713,2720,2727,2734,2777,2792,2795,2801,2804,2810,2813,2819,2822,2828,2831,2837,2840,2846],{"stroke":940,"style":941},[938,2616,2619,2627],{"stroke":944,"fontFamily":2617,"fontSize":2618},"cmr8","8",[938,2620,2622],{"transform":2621},"translate(-68.085 2)",[545,2623],{"d":2624,"fill":940,"stroke":940,"className":2625,"style":2626},"M6.967-45.873L6.686-45.873L6.686-50.592Q6.686-50.807 6.624-50.902Q6.561-50.998 6.444-51.019Q6.327-51.041 6.081-51.041L6.081-51.338L7.303-51.424L7.303-48.935Q7.780-49.400 8.479-49.400Q8.960-49.400 9.368-49.156Q9.776-48.912 10.012-48.498Q10.249-48.084 10.249-47.600Q10.249-47.225 10.100-46.896Q9.952-46.568 9.682-46.316Q9.413-46.064 9.069-45.930Q8.725-45.795 8.366-45.795Q8.045-45.795 7.747-45.943Q7.448-46.092 7.241-46.353L6.967-45.873M7.327-48.545L7.327-46.705Q7.479-46.408 7.739-46.228Q7.999-46.049 8.311-46.049Q8.737-46.049 9.004-46.268Q9.272-46.486 9.387-46.832Q9.503-47.178 9.503-47.600Q9.503-48.248 9.254-48.697Q9.006-49.146 8.409-49.146Q8.073-49.146 7.784-48.988Q7.495-48.830 7.327-48.545",[955],"stroke-width:0.240",[938,2628,2629],{"transform":2621},[545,2630],{"d":2631,"fill":940,"stroke":940,"className":2632,"style":2626},"M11.011-47.568Q11.011-48.072 11.267-48.504Q11.523-48.935 11.959-49.187Q12.394-49.439 12.894-49.439Q13.281-49.439 13.623-49.295Q13.964-49.150 14.226-48.889Q14.488-48.627 14.630-48.291Q14.773-47.955 14.773-47.568Q14.773-47.076 14.509-46.666Q14.246-46.256 13.816-46.025Q13.386-45.795 12.894-45.795Q12.402-45.795 11.968-46.027Q11.535-46.260 11.273-46.668Q11.011-47.076 11.011-47.568M12.894-46.072Q13.351-46.072 13.603-46.295Q13.855-46.518 13.943-46.869Q14.031-47.221 14.031-47.666Q14.031-48.096 13.937-48.434Q13.843-48.771 13.589-48.978Q13.335-49.185 12.894-49.185Q12.246-49.185 12.002-48.769Q11.757-48.353 11.757-47.666Q11.757-47.221 11.845-46.869Q11.933-46.518 12.185-46.295Q12.437-46.072 12.894-46.072M15.882-46.834L15.882-49.025L15.179-49.025L15.179-49.279Q15.535-49.279 15.777-49.512Q16.019-49.744 16.130-50.092Q16.242-50.439 16.242-50.795L16.523-50.795L16.523-49.322L17.699-49.322L17.699-49.025L16.523-49.025L16.523-46.850Q16.523-46.529 16.642-46.301Q16.761-46.072 17.043-46.072Q17.222-46.072 17.339-46.195Q17.457-46.318 17.509-46.498Q17.562-46.678 17.562-46.850L17.562-47.322L17.843-47.322L17.843-46.834Q17.843-46.580 17.738-46.340Q17.632-46.100 17.435-45.947Q17.238-45.795 16.980-45.795Q16.664-45.795 16.412-45.918Q16.160-46.041 16.021-46.275Q15.882-46.510 15.882-46.834M19.187-46.834L19.187-49.025L18.484-49.025L18.484-49.279Q18.839-49.279 19.082-49.512Q19.324-49.744 19.435-50.092Q19.546-50.439 19.546-50.795L19.828-50.795L19.828-49.322L21.003-49.322L21.003-49.025L19.828-49.025L19.828-46.850Q19.828-46.529 19.947-46.301Q20.066-46.072 20.347-46.072Q20.527-46.072 20.644-46.195Q20.761-46.318 20.814-46.498Q20.867-46.678 20.867-46.850L20.867-47.322L21.148-47.322L21.148-46.834Q21.148-46.580 21.043-46.340Q20.937-46.100 20.740-45.947Q20.543-45.795 20.285-45.795Q19.968-45.795 19.716-45.918Q19.464-46.041 19.326-46.275Q19.187-46.510 19.187-46.834M21.867-47.568Q21.867-48.072 22.123-48.504Q22.378-48.935 22.814-49.187Q23.250-49.439 23.750-49.439Q24.136-49.439 24.478-49.295Q24.820-49.150 25.082-48.889Q25.343-48.627 25.486-48.291Q25.628-47.955 25.628-47.568Q25.628-47.076 25.365-46.666Q25.101-46.256 24.671-46.025Q24.242-45.795 23.750-45.795Q23.257-45.795 22.824-46.027Q22.390-46.260 22.128-46.668Q21.867-47.076 21.867-47.568M23.750-46.072Q24.207-46.072 24.459-46.295Q24.710-46.518 24.798-46.869Q24.886-47.221 24.886-47.666Q24.886-48.096 24.793-48.434Q24.699-48.771 24.445-48.978Q24.191-49.185 23.750-49.185Q23.101-49.185 22.857-48.769Q22.613-48.353 22.613-47.666Q22.613-47.221 22.701-46.869Q22.789-46.518 23.041-46.295Q23.293-46.072 23.750-46.072M28.043-45.873L26.187-45.873L26.187-46.170Q26.460-46.170 26.628-46.217Q26.796-46.264 26.796-46.432L26.796-48.568Q26.796-48.783 26.734-48.879Q26.671-48.975 26.552-48.996Q26.433-49.018 26.187-49.018L26.187-49.314L27.378-49.400L27.378-48.666Q27.492-48.881 27.685-49.049Q27.878-49.217 28.117-49.309Q28.355-49.400 28.609-49.400Q29.570-49.400 29.746-48.689Q29.929-49.018 30.257-49.209Q30.585-49.400 30.964-49.400Q32.140-49.400 32.140-48.322L32.140-46.432Q32.140-46.264 32.308-46.217Q32.476-46.170 32.746-46.170L32.746-45.873L30.890-45.873L30.890-46.170Q31.164-46.170 31.332-46.215Q31.500-46.260 31.500-46.432L31.500-48.307Q31.500-48.693 31.375-48.920Q31.250-49.146 30.898-49.146Q30.593-49.146 30.337-48.984Q30.082-48.822 29.933-48.553Q29.785-48.283 29.785-47.986L29.785-46.432Q29.785-46.264 29.955-46.217Q30.125-46.170 30.394-46.170L30.394-45.873L28.539-45.873L28.539-46.170Q28.812-46.170 28.980-46.217Q29.148-46.264 29.148-46.432L29.148-48.307Q29.148-48.693 29.023-48.920Q28.898-49.146 28.546-49.146Q28.242-49.146 27.986-48.984Q27.730-48.822 27.582-48.553Q27.433-48.283 27.433-47.986L27.433-46.432Q27.433-46.264 27.603-46.217Q27.773-46.170 28.043-46.170L28.043-45.873M35.304-47.322L33.050-47.322L33.050-47.873L35.304-47.873L35.304-47.322M36.707-46.826L36.707-48.568Q36.707-48.783 36.644-48.879Q36.582-48.975 36.462-48.996Q36.343-49.018 36.097-49.018L36.097-49.314L37.343-49.400L37.343-46.850L37.343-46.826Q37.343-46.514 37.398-46.352Q37.453-46.189 37.603-46.119Q37.753-46.049 38.074-46.049Q38.503-46.049 38.777-46.387Q39.050-46.725 39.050-47.170L39.050-48.568Q39.050-48.783 38.988-48.879Q38.925-48.975 38.806-48.996Q38.687-49.018 38.441-49.018L38.441-49.314L39.687-49.400L39.687-46.615Q39.687-46.404 39.750-46.309Q39.812-46.213 39.931-46.191Q40.050-46.170 40.296-46.170L40.296-45.873L39.074-45.795L39.074-46.416Q38.906-46.127 38.625-45.961Q38.343-45.795 38.023-45.795Q36.707-45.795 36.707-46.826M42.625-44.322L40.769-44.322L40.769-44.615Q41.039-44.615 41.207-44.660Q41.375-44.705 41.375-44.881L41.375-48.705Q41.375-48.912 41.218-48.965Q41.062-49.018 40.769-49.018L40.769-49.314L41.992-49.400L41.992-48.935Q42.222-49.158 42.537-49.279Q42.851-49.400 43.191-49.400Q43.664-49.400 44.068-49.154Q44.472-48.908 44.705-48.492Q44.937-48.076 44.937-47.600Q44.937-47.225 44.789-46.896Q44.640-46.568 44.371-46.316Q44.101-46.064 43.757-45.930Q43.414-45.795 43.054-45.795Q42.765-45.795 42.494-45.916Q42.222-46.037 42.015-46.248L42.015-44.881Q42.015-44.705 42.183-44.660Q42.351-44.615 42.625-44.615L42.625-44.322M42.015-48.537L42.015-46.697Q42.168-46.408 42.429-46.228Q42.691-46.049 43-46.049Q43.285-46.049 43.507-46.187Q43.730-46.326 43.882-46.557Q44.035-46.787 44.113-47.059Q44.191-47.330 44.191-47.600Q44.191-47.932 44.066-48.289Q43.941-48.646 43.693-48.883Q43.445-49.119 43.097-49.119Q42.773-49.119 42.478-48.963Q42.183-48.807 42.015-48.537",[955],[545,2634],{"fill":944,"d":2635},"M-6.989-33.07h25.607v-25.607H-6.989Z",[938,2637,2639],{"transform":2638},"translate(-2.312 2.9)",[545,2640],{"d":2641,"fill":940,"stroke":940,"className":2642,"style":1965},"M8.127-45.675Q7.002-45.675 6.588-46.572Q6.175-47.468 6.175-48.743Q6.175-49.516 6.325-50.215Q6.474-50.914 6.909-51.390Q7.344-51.867 8.127-51.867Q8.904-51.867 9.339-51.388Q9.774-50.909 9.924-50.213Q10.073-49.516 10.073-48.743Q10.073-47.464 9.660-46.570Q9.247-45.675 8.127-45.675M8.127-45.935Q8.645-45.935 8.896-46.446Q9.146-46.958 9.203-47.569Q9.260-48.180 9.260-48.888Q9.260-49.573 9.203-50.133Q9.146-50.694 8.893-51.151Q8.641-51.608 8.127-51.608Q7.722-51.608 7.485-51.331Q7.248-51.054 7.140-50.613Q7.032-50.171 7.008-49.778Q6.984-49.384 6.984-48.888Q6.984-48.382 7.008-47.954Q7.032-47.525 7.140-47.042Q7.248-46.559 7.487-46.247Q7.727-45.935 8.127-45.935",[955],[545,2644],{"fill":944,"d":2645},"M21.464-33.07H47.07v-25.607H21.464Z",[938,2647,2649],{"transform":2648},"translate(26.14 2.9)",[545,2650],{"d":2651,"fill":940,"stroke":940,"className":2652,"style":1965},"M9.722-45.873L6.690-45.873L6.690-46.189Q7.841-46.189 7.841-46.484L7.841-51.208Q7.353-50.975 6.632-50.975L6.632-51.291Q7.762-51.291 8.324-51.867L8.469-51.867Q8.504-51.867 8.537-51.834Q8.570-51.801 8.570-51.766L8.570-46.484Q8.570-46.189 9.722-46.189",[955],[545,2654],{"fill":944,"d":2655},"M49.917-33.07h25.607v-25.607H49.917Z",[938,2657,2659],{"transform":2658},"translate(54.593 2.9)",[545,2660],{"d":2651,"fill":940,"stroke":940,"className":2661,"style":1965},[955],[545,2663],{"fill":944,"d":2664},"M78.37-33.07h25.607v-25.607H78.369Z",[938,2666,2668],{"transform":2667},"translate(83.046 2.9)",[545,2669],{"d":2670,"fill":940,"stroke":940,"className":2671,"style":1965},"M9.722-45.873L6.272-45.873L6.272-46.106Q6.272-46.119 6.303-46.150L7.757-47.727Q8.223-48.224 8.476-48.529Q8.729-48.835 8.920-49.246Q9.111-49.657 9.111-50.096Q9.111-50.685 8.788-51.118Q8.465-51.551 7.885-51.551Q7.621-51.551 7.375-51.441Q7.129-51.331 6.953-51.144Q6.777-50.957 6.681-50.707L6.760-50.707Q6.962-50.707 7.105-50.571Q7.248-50.435 7.248-50.219Q7.248-50.013 7.105-49.874Q6.962-49.736 6.760-49.736Q6.558-49.736 6.415-49.879Q6.272-50.021 6.272-50.219Q6.272-50.681 6.509-51.054Q6.747-51.428 7.147-51.647Q7.546-51.867 7.995-51.867Q8.518-51.867 8.972-51.652Q9.427-51.436 9.700-51.037Q9.972-50.637 9.972-50.096Q9.972-49.701 9.801-49.347Q9.629-48.993 9.364-48.714Q9.098-48.435 8.647-48.050Q8.197-47.666 8.118-47.591L7.094-46.629L7.911-46.629Q8.562-46.629 8.999-46.640Q9.436-46.651 9.467-46.673Q9.537-46.756 9.592-46.996Q9.647-47.235 9.687-47.503L9.972-47.503",[955],[545,2673],{"fill":944,"d":2674},"M106.822-33.07h25.607v-25.607h-25.607Z",[938,2676,2678],{"transform":2677},"translate(111.498 2.9)",[545,2679],{"d":2680,"fill":940,"stroke":940,"className":2681,"style":1965},"M6.716-46.594L6.672-46.594Q6.874-46.277 7.261-46.119Q7.648-45.961 8.074-45.961Q8.610-45.961 8.849-46.396Q9.089-46.831 9.089-47.411Q9.089-47.991 8.843-48.431Q8.597-48.870 8.065-48.870L7.445-48.870Q7.419-48.870 7.386-48.899Q7.353-48.927 7.353-48.949L7.353-49.050Q7.353-49.081 7.382-49.105Q7.410-49.129 7.445-49.129L7.964-49.169Q8.430-49.169 8.676-49.641Q8.922-50.114 8.922-50.632Q8.922-51.059 8.709-51.333Q8.496-51.608 8.074-51.608Q7.731-51.608 7.406-51.478Q7.081-51.349 6.896-51.094L6.922-51.094Q7.125-51.094 7.261-50.953Q7.397-50.812 7.397-50.615Q7.397-50.417 7.263-50.283Q7.129-50.149 6.931-50.149Q6.729-50.149 6.591-50.283Q6.452-50.417 6.452-50.615Q6.452-51.204 6.955-51.535Q7.459-51.867 8.074-51.867Q8.452-51.867 8.854-51.727Q9.256-51.586 9.524-51.307Q9.792-51.028 9.792-50.632Q9.792-50.083 9.438-49.646Q9.085-49.208 8.544-49.024Q8.935-48.945 9.280-48.721Q9.625-48.497 9.836-48.156Q10.047-47.815 10.047-47.420Q10.047-47.038 9.884-46.715Q9.722-46.392 9.430-46.156Q9.137-45.921 8.790-45.798Q8.443-45.675 8.074-45.675Q7.626-45.675 7.195-45.836Q6.764-45.996 6.483-46.323Q6.202-46.651 6.202-47.108Q6.202-47.323 6.349-47.466Q6.496-47.609 6.716-47.609Q6.927-47.609 7.072-47.464Q7.217-47.319 7.217-47.108Q7.217-46.897 7.070-46.745Q6.922-46.594 6.716-46.594",[955],[545,2683],{"fill":944,"d":2684},"M135.275-33.07h25.607v-25.607h-25.607Z",[938,2686,2688],{"transform":2687},"translate(139.951 2.9)",[545,2689],{"d":2690,"fill":940,"stroke":940,"className":2691,"style":1965},"M6.641-46.879Q6.782-46.466 7.142-46.214Q7.503-45.961 7.938-45.961Q8.390-45.961 8.656-46.214Q8.922-46.466 9.025-46.851Q9.128-47.235 9.128-47.692Q9.128-49.393 8.219-49.393Q7.898-49.393 7.669-49.299Q7.441-49.204 7.311-49.085Q7.182-48.967 7.070-48.828Q6.958-48.690 6.922-48.681L6.839-48.681Q6.795-48.681 6.764-48.712Q6.733-48.743 6.733-48.791L6.733-51.788Q6.733-51.819 6.769-51.843Q6.804-51.867 6.830-51.867L6.870-51.867Q7.503-51.577 8.175-51.577Q8.847-51.577 9.489-51.867L9.515-51.867Q9.546-51.867 9.579-51.845Q9.612-51.823 9.612-51.788L9.612-51.687Q9.612-51.683 9.603-51.665Q9.594-51.647 9.594-51.643Q9.278-51.248 8.808-51.026Q8.337-50.804 7.841-50.804Q7.432-50.804 7.050-50.914L7.050-49.195Q7.507-49.652 8.219-49.652Q8.729-49.652 9.128-49.371Q9.528-49.090 9.750-48.635Q9.972-48.180 9.972-47.675Q9.972-47.125 9.693-46.666Q9.414-46.207 8.948-45.941Q8.482-45.675 7.938-45.675Q7.498-45.675 7.114-45.902Q6.729-46.128 6.501-46.508Q6.272-46.888 6.272-47.332Q6.272-47.525 6.404-47.657Q6.536-47.789 6.733-47.789Q6.865-47.789 6.969-47.730Q7.072-47.670 7.131-47.567Q7.190-47.464 7.190-47.332Q7.190-47.134 7.063-47.002Q6.936-46.871 6.733-46.871Q6.672-46.871 6.641-46.879",[955],[938,2693,2695],{"transform":2694},"translate(-2.125 -17.908)",[545,2696],{"d":2697,"fill":940,"stroke":940,"className":2698,"style":2626},"M7.936-45.705Q7.233-45.705 6.833-46.105Q6.432-46.506 6.288-47.115Q6.143-47.725 6.143-48.424Q6.143-48.947 6.213-49.410Q6.284-49.873 6.477-50.285Q6.670-50.697 7.028-50.945Q7.385-51.193 7.936-51.193Q8.487-51.193 8.844-50.945Q9.202-50.697 9.393-50.287Q9.585-49.877 9.655-49.408Q9.725-48.939 9.725-48.424Q9.725-47.725 9.583-47.117Q9.440-46.510 9.040-46.107Q8.639-45.705 7.936-45.705M7.936-45.963Q8.409-45.963 8.641-46.398Q8.874-46.834 8.928-47.373Q8.983-47.912 8.983-48.553Q8.983-49.549 8.799-50.242Q8.616-50.935 7.936-50.935Q7.569-50.935 7.348-50.697Q7.128-50.459 7.032-50.102Q6.936-49.744 6.911-49.373Q6.885-49.002 6.885-48.553Q6.885-47.912 6.940-47.373Q6.995-46.834 7.227-46.398Q7.460-45.963 7.936-45.963",[955],[938,2700,2702],{"transform":2701},"translate(26.328 -17.908)",[545,2703],{"d":2704,"fill":940,"stroke":940,"className":2705,"style":2626},"M9.409-45.873L6.616-45.873L6.616-46.170Q7.678-46.170 7.678-46.432L7.678-50.600Q7.249-50.385 6.569-50.385L6.569-50.682Q7.588-50.682 8.104-51.193L8.249-51.193Q8.323-51.174 8.342-51.096L8.342-46.432Q8.342-46.170 9.409-46.170",[955],[938,2707,2709],{"transform":2708},"translate(54.78 -17.908)",[545,2710],{"d":2711,"fill":940,"stroke":940,"className":2712,"style":2626},"M9.401-45.873L6.241-45.873L6.241-46.080Q6.241-46.107 6.264-46.139L7.616-47.537Q7.995-47.924 8.243-48.213Q8.491-48.502 8.665-48.859Q8.838-49.217 8.838-49.607Q8.838-49.955 8.706-50.248Q8.573-50.541 8.319-50.719Q8.065-50.896 7.710-50.896Q7.350-50.896 7.059-50.701Q6.768-50.506 6.624-50.178L6.678-50.178Q6.862-50.178 6.987-50.057Q7.112-49.935 7.112-49.744Q7.112-49.564 6.987-49.435Q6.862-49.307 6.678-49.307Q6.499-49.307 6.370-49.435Q6.241-49.564 6.241-49.744Q6.241-50.146 6.461-50.482Q6.682-50.818 7.047-51.006Q7.413-51.193 7.815-51.193Q8.295-51.193 8.711-51.006Q9.128-50.818 9.379-50.457Q9.631-50.096 9.631-49.607Q9.631-49.248 9.477-48.945Q9.323-48.643 9.071-48.383Q8.819-48.123 8.469-47.838Q8.120-47.553 7.952-47.400L7.022-46.560L7.737-46.560Q9.112-46.560 9.151-46.600Q9.221-46.678 9.264-46.863Q9.307-47.049 9.350-47.338L9.631-47.338",[955],[938,2714,2716],{"transform":2715},"translate(83.233 -17.908)",[545,2717],{"d":2718,"fill":940,"stroke":940,"className":2719,"style":2626},"M6.608-46.506Q6.799-46.232 7.155-46.105Q7.510-45.978 7.893-45.978Q8.229-45.978 8.438-46.164Q8.647-46.350 8.743-46.643Q8.838-46.935 8.838-47.248Q8.838-47.572 8.741-47.867Q8.643-48.162 8.430-48.346Q8.217-48.529 7.885-48.529L7.319-48.529Q7.288-48.529 7.258-48.559Q7.229-48.588 7.229-48.615L7.229-48.697Q7.229-48.732 7.258-48.758Q7.288-48.783 7.319-48.783L7.799-48.818Q8.085-48.818 8.282-49.023Q8.479-49.228 8.575-49.523Q8.670-49.818 8.670-50.096Q8.670-50.475 8.471-50.713Q8.272-50.951 7.893-50.951Q7.573-50.951 7.284-50.844Q6.995-50.736 6.831-50.514Q7.010-50.514 7.133-50.387Q7.256-50.260 7.256-50.088Q7.256-49.916 7.131-49.791Q7.006-49.666 6.831-49.666Q6.659-49.666 6.534-49.791Q6.409-49.916 6.409-50.088Q6.409-50.455 6.633-50.703Q6.858-50.951 7.198-51.072Q7.538-51.193 7.893-51.193Q8.241-51.193 8.604-51.072Q8.967-50.951 9.215-50.701Q9.463-50.451 9.463-50.096Q9.463-49.611 9.145-49.228Q8.827-48.846 8.350-48.674Q8.901-48.564 9.301-48.178Q9.702-47.791 9.702-47.256Q9.702-46.799 9.438-46.443Q9.174-46.088 8.753-45.896Q8.331-45.705 7.893-45.705Q7.483-45.705 7.090-45.840Q6.698-45.975 6.432-46.260Q6.167-46.545 6.167-46.963Q6.167-47.158 6.299-47.287Q6.432-47.416 6.624-47.416Q6.749-47.416 6.852-47.357Q6.956-47.299 7.018-47.193Q7.081-47.088 7.081-46.963Q7.081-46.768 6.946-46.637Q6.811-46.506 6.608-46.506",[955],[938,2721,2723],{"transform":2722},"translate(111.686 -17.908)",[545,2724],{"d":2725,"fill":940,"stroke":940,"className":2726,"style":2626},"M8.295-47.185L6.053-47.185L6.053-47.482L8.624-51.139Q8.663-51.193 8.725-51.193L8.870-51.193Q8.920-51.193 8.952-51.162Q8.983-51.131 8.983-51.080L8.983-47.482L9.815-47.482L9.815-47.185L8.983-47.185L8.983-46.432Q8.983-46.170 9.807-46.170L9.807-45.873L7.471-45.873L7.471-46.170Q8.295-46.170 8.295-46.432L8.295-47.185M8.350-50.287L6.381-47.482L8.350-47.482",[955],[938,2728,2730],{"transform":2729},"translate(140.139 -17.908)",[545,2731],{"d":2732,"fill":940,"stroke":940,"className":2733,"style":2626},"M6.655-46.752L6.592-46.752Q6.733-46.400 7.057-46.189Q7.381-45.978 7.768-45.978Q8.362-45.978 8.612-46.412Q8.862-46.846 8.862-47.482Q8.862-48.076 8.692-48.523Q8.522-48.971 8.022-48.971Q7.725-48.971 7.520-48.891Q7.315-48.810 7.213-48.719Q7.112-48.627 6.997-48.494Q6.881-48.361 6.831-48.346L6.760-48.346Q6.674-48.369 6.655-48.447L6.655-51.096Q6.686-51.193 6.760-51.193Q6.776-51.193 6.784-51.191Q6.792-51.189 6.799-51.185Q7.385-50.935 7.983-50.935Q8.565-50.935 9.182-51.193L9.206-51.193Q9.249-51.193 9.276-51.168Q9.303-51.143 9.303-51.103L9.303-51.025Q9.303-50.994 9.280-50.971Q8.983-50.619 8.561-50.422Q8.139-50.225 7.678-50.225Q7.331-50.225 6.952-50.330L6.952-48.834Q7.170-49.029 7.446-49.127Q7.721-49.225 8.022-49.225Q8.479-49.225 8.848-48.977Q9.217-48.728 9.424-48.324Q9.631-47.920 9.631-47.475Q9.631-46.986 9.376-46.578Q9.120-46.170 8.688-45.937Q8.256-45.705 7.768-45.705Q7.374-45.705 7.018-45.896Q6.663-46.088 6.452-46.422Q6.241-46.756 6.241-47.170Q6.241-47.350 6.358-47.463Q6.475-47.576 6.655-47.576Q6.772-47.576 6.864-47.523Q6.956-47.471 7.008-47.379Q7.061-47.287 7.061-47.170Q7.061-46.986 6.948-46.869Q6.835-46.752 6.655-46.752",[955],[938,2735,2738,2741,2744],{"fill":2736,"stroke":2736,"style":2737},"var(--tk-warn)","stroke-width:.8",[545,2739],{"fill":944,"d":2740},"M-9.834-28.233h169.436",[545,2742],{"d":2743},"m162.588-28.233-4.169-1.576 1.383 1.576-1.383 1.577Z",[938,2745,2746,2753,2759,2765,2771],{"fill":2736,"stroke":944,"fontSize":2618},[938,2747,2749],{"transform":2748},"translate(43.027 26.93)",[545,2750],{"d":2751,"fill":2736,"stroke":2736,"className":2752,"style":2626},"M7.913-45.873L6.081-45.873L6.081-46.170Q6.350-46.170 6.518-46.215Q6.686-46.260 6.686-46.432L6.686-49.025L6.045-49.025L6.045-49.322L6.686-49.322L6.686-50.256Q6.686-50.670 6.995-50.951Q7.303-51.232 7.749-51.369Q8.194-51.506 8.600-51.506Q9.003-51.506 9.321-51.279Q9.639-51.053 9.639-50.666Q9.639-50.490 9.526-50.377Q9.413-50.264 9.241-50.264Q9.065-50.264 8.952-50.377Q8.838-50.490 8.838-50.666Q8.838-50.810 8.928-50.920Q9.018-51.029 9.151-51.057Q8.866-51.248 8.518-51.248Q8.221-51.248 7.934-51.127Q7.647-51.006 7.463-50.773Q7.280-50.541 7.280-50.240L7.280-49.322L8.432-49.322L9.655-49.416L9.655-46.432Q9.655-46.264 9.823-46.217Q9.991-46.170 10.264-46.170L10.264-45.873L8.432-45.873L8.432-46.170Q8.702-46.170 8.870-46.215Q9.038-46.260 9.038-46.432L9.038-48.592Q9.038-48.799 8.991-48.898Q8.944-48.998 8.768-49.025L7.303-49.025L7.303-46.432Q7.303-46.264 7.471-46.217Q7.639-46.170 7.913-46.170L7.913-45.873M12.686-45.873L10.854-45.873L10.854-46.170Q11.128-46.170 11.295-46.217Q11.463-46.264 11.463-46.432L11.463-50.592Q11.463-50.807 11.401-50.902Q11.338-50.998 11.219-51.019Q11.100-51.041 10.854-51.041L10.854-51.338L12.077-51.424L12.077-46.432Q12.077-46.264 12.245-46.217Q12.413-46.170 12.686-46.170L12.686-45.873M15.045-45.873L13.213-45.873L13.213-46.170Q13.487-46.170 13.655-46.217Q13.823-46.264 13.823-46.432L13.823-50.592Q13.823-50.807 13.760-50.902Q13.698-50.998 13.579-51.019Q13.460-51.041 13.213-51.041L13.213-51.338L14.436-51.424L14.436-46.432Q14.436-46.264 14.604-46.217Q14.772-46.170 15.045-46.170",[955],[938,2754,2755],{"transform":2748},[545,2756],{"d":2757,"fill":2736,"stroke":2736,"className":2758,"style":2626},"M18.331-47.568Q18.331-48.072 18.587-48.504Q18.843-48.935 19.279-49.187Q19.714-49.439 20.214-49.439Q20.601-49.439 20.943-49.295Q21.284-49.150 21.546-48.889Q21.808-48.627 21.950-48.291Q22.093-47.955 22.093-47.568Q22.093-47.076 21.829-46.666Q21.566-46.256 21.136-46.025Q20.706-45.795 20.214-45.795Q19.722-45.795 19.288-46.027Q18.855-46.260 18.593-46.668Q18.331-47.076 18.331-47.568M20.214-46.072Q20.671-46.072 20.923-46.295Q21.175-46.518 21.263-46.869Q21.351-47.221 21.351-47.666Q21.351-48.096 21.257-48.434Q21.163-48.771 20.909-48.978Q20.656-49.185 20.214-49.185Q19.566-49.185 19.322-48.769Q19.077-48.353 19.077-47.666Q19.077-47.221 19.165-46.869Q19.253-46.518 19.505-46.295Q19.757-46.072 20.214-46.072M24.585-45.873L22.605-45.873L22.605-46.170Q22.874-46.170 23.042-46.215Q23.210-46.260 23.210-46.432L23.210-48.568Q23.210-48.783 23.148-48.879Q23.085-48.975 22.968-48.996Q22.851-49.018 22.605-49.018L22.605-49.314L23.773-49.400L23.773-48.615Q23.851-48.826 24.003-49.012Q24.155-49.197 24.355-49.299Q24.554-49.400 24.781-49.400Q25.027-49.400 25.218-49.256Q25.409-49.111 25.409-48.881Q25.409-48.725 25.304-48.615Q25.198-48.506 25.042-48.506Q24.886-48.506 24.777-48.615Q24.667-48.725 24.667-48.881Q24.667-49.041 24.773-49.146Q24.448-49.146 24.234-48.918Q24.019-48.689 23.923-48.350Q23.827-48.010 23.827-47.705L23.827-46.432Q23.827-46.264 24.054-46.217Q24.280-46.170 24.585-46.170L24.585-45.873M27.706-45.795Q27.226-45.795 26.818-46.039Q26.409-46.283 26.171-46.697Q25.933-47.111 25.933-47.600Q25.933-48.092 26.191-48.508Q26.448-48.924 26.880-49.162Q27.312-49.400 27.804-49.400Q28.425-49.400 28.874-48.963L28.874-50.592Q28.874-50.807 28.812-50.902Q28.749-50.998 28.632-51.019Q28.515-51.041 28.269-51.041L28.269-51.338L29.491-51.424L29.491-46.615Q29.491-46.404 29.554-46.309Q29.616-46.213 29.734-46.191Q29.851-46.170 30.101-46.170L30.101-45.873L28.851-45.795L28.851-46.279Q28.386-45.795 27.706-45.795M27.773-46.049Q28.113-46.049 28.405-46.240Q28.698-46.432 28.851-46.728L28.851-48.560Q28.702-48.834 28.441-48.990Q28.179-49.146 27.866-49.146Q27.241-49.146 26.958-48.699Q26.675-48.252 26.675-47.592Q26.675-46.947 26.927-46.498Q27.179-46.049 27.773-46.049M30.609-47.627Q30.609-48.107 30.841-48.523Q31.073-48.939 31.484-49.189Q31.894-49.439 32.370-49.439Q33.101-49.439 33.499-48.998Q33.898-48.557 33.898-47.826Q33.898-47.721 33.804-47.697L31.355-47.697L31.355-47.627Q31.355-47.217 31.476-46.861Q31.597-46.506 31.868-46.289Q32.140-46.072 32.570-46.072Q32.933-46.072 33.230-46.301Q33.527-46.529 33.628-46.881Q33.636-46.928 33.722-46.943L33.804-46.943Q33.898-46.916 33.898-46.834Q33.898-46.826 33.890-46.795Q33.827-46.568 33.689-46.385Q33.550-46.201 33.359-46.068Q33.167-45.935 32.948-45.865Q32.730-45.795 32.491-45.795Q32.120-45.795 31.782-45.932Q31.445-46.068 31.177-46.320Q30.909-46.572 30.759-46.912Q30.609-47.252 30.609-47.627M31.363-47.935L33.323-47.935Q33.323-48.240 33.222-48.531Q33.120-48.822 32.904-49.004Q32.687-49.185 32.370-49.185Q32.070-49.185 31.839-48.998Q31.609-48.810 31.486-48.519Q31.363-48.228 31.363-47.935M36.394-45.873L34.413-45.873L34.413-46.170Q34.683-46.170 34.851-46.215Q35.019-46.260 35.019-46.432L35.019-48.568Q35.019-48.783 34.956-48.879Q34.894-48.975 34.777-48.996Q34.659-49.018 34.413-49.018L34.413-49.314L35.581-49.400L35.581-48.615Q35.659-48.826 35.812-49.012Q35.964-49.197 36.163-49.299Q36.363-49.400 36.589-49.400Q36.835-49.400 37.027-49.256Q37.218-49.111 37.218-48.881Q37.218-48.725 37.113-48.615Q37.007-48.506 36.851-48.506Q36.695-48.506 36.585-48.615Q36.476-48.725 36.476-48.881Q36.476-49.041 36.581-49.146Q36.257-49.146 36.042-48.918Q35.827-48.689 35.732-48.350Q35.636-48.010 35.636-47.705L35.636-46.432Q35.636-46.264 35.863-46.217Q36.089-46.170 36.394-46.170",[955],[938,2760,2761],{"transform":2748},[545,2762],{"d":2763,"fill":2736,"stroke":2736,"className":2764,"style":2626},"M42.422-45.705Q41.719-45.705 41.319-46.105Q40.918-46.506 40.774-47.115Q40.629-47.725 40.629-48.424Q40.629-48.947 40.699-49.410Q40.770-49.873 40.963-50.285Q41.156-50.697 41.514-50.945Q41.871-51.193 42.422-51.193Q42.973-51.193 43.330-50.945Q43.688-50.697 43.879-50.287Q44.071-49.877 44.141-49.408Q44.211-48.939 44.211-48.424Q44.211-47.725 44.069-47.117Q43.926-46.510 43.526-46.107Q43.125-45.705 42.422-45.705M42.422-45.963Q42.895-45.963 43.127-46.398Q43.360-46.834 43.414-47.373Q43.469-47.912 43.469-48.553Q43.469-49.549 43.285-50.242Q43.102-50.935 42.422-50.935Q42.055-50.935 41.834-50.697Q41.614-50.459 41.518-50.102Q41.422-49.744 41.397-49.373Q41.371-49.002 41.371-48.553Q41.371-47.912 41.426-47.373Q41.481-46.834 41.713-46.398Q41.946-45.963 42.422-45.963",[955],[938,2766,2767],{"transform":2748},[545,2768],{"d":2769,"fill":2736,"stroke":2736,"className":2770,"style":2626},"M53.905-47.689L47.561-47.689Q47.487-47.689 47.436-47.746Q47.386-47.803 47.386-47.873Q47.386-47.943 47.433-48Q47.479-48.057 47.561-48.057L53.905-48.057Q53.452-48.385 53.155-48.852Q52.858-49.318 52.753-49.857Q52.753-49.959 52.850-49.986L53.018-49.986Q53.100-49.967 53.120-49.881Q53.249-49.205 53.729-48.687Q54.210-48.170 54.874-47.978Q54.936-47.955 54.936-47.873Q54.936-47.791 54.874-47.768Q54.210-47.580 53.729-47.060Q53.249-46.541 53.120-45.865Q53.100-45.779 53.018-45.760L52.850-45.760Q52.753-45.787 52.753-45.889Q52.827-46.256 52.985-46.588Q53.143-46.920 53.376-47.197Q53.608-47.475 53.905-47.689",[955],[938,2772,2773],{"transform":2748},[545,2774],{"d":2775,"fill":2736,"stroke":2736,"className":2776,"style":2626},"M58.614-46.752L58.551-46.752Q58.692-46.400 59.016-46.189Q59.340-45.978 59.727-45.978Q60.321-45.978 60.571-46.412Q60.821-46.846 60.821-47.482Q60.821-48.076 60.651-48.523Q60.481-48.971 59.981-48.971Q59.684-48.971 59.479-48.891Q59.274-48.810 59.172-48.719Q59.071-48.627 58.956-48.494Q58.840-48.361 58.790-48.346L58.719-48.346Q58.633-48.369 58.614-48.447L58.614-51.096Q58.645-51.193 58.719-51.193Q58.735-51.193 58.743-51.191Q58.751-51.189 58.758-51.185Q59.344-50.935 59.942-50.935Q60.524-50.935 61.141-51.193L61.165-51.193Q61.208-51.193 61.235-51.168Q61.262-51.143 61.262-51.103L61.262-51.025Q61.262-50.994 61.239-50.971Q60.942-50.619 60.520-50.422Q60.098-50.225 59.637-50.225Q59.290-50.225 58.911-50.330L58.911-48.834Q59.129-49.029 59.405-49.127Q59.680-49.225 59.981-49.225Q60.438-49.225 60.807-48.977Q61.176-48.728 61.383-48.324Q61.590-47.920 61.590-47.475Q61.590-46.986 61.335-46.578Q61.079-46.170 60.647-45.937Q60.215-45.705 59.727-45.705Q59.333-45.705 58.977-45.896Q58.622-46.088 58.411-46.422Q58.200-46.756 58.200-47.170Q58.200-47.350 58.317-47.463Q58.434-47.576 58.614-47.576Q58.731-47.576 58.823-47.523Q58.915-47.471 58.967-47.379Q59.020-47.287 59.020-47.170Q59.020-46.986 58.907-46.869Q58.794-46.752 58.614-46.752",[955],[938,2778,2779,2786],{"stroke":944,"fontFamily":2617,"fontSize":2618},[938,2780,2782],{"transform":2781},"translate(-65.724 61.75)",[545,2783],{"d":2784,"fill":940,"stroke":940,"className":2785,"style":2626},"M6.678-46.834L6.678-49.025L5.975-49.025L5.975-49.279Q6.331-49.279 6.573-49.512Q6.815-49.744 6.926-50.092Q7.038-50.439 7.038-50.795L7.319-50.795L7.319-49.322L8.495-49.322L8.495-49.025L7.319-49.025L7.319-46.850Q7.319-46.529 7.438-46.301Q7.557-46.072 7.838-46.072Q8.018-46.072 8.135-46.195Q8.253-46.318 8.305-46.498Q8.358-46.678 8.358-46.850L8.358-47.322L8.639-47.322L8.639-46.834Q8.639-46.580 8.534-46.340Q8.428-46.100 8.231-45.947Q8.034-45.795 7.776-45.795Q7.460-45.795 7.208-45.918Q6.956-46.041 6.817-46.275Q6.678-46.510 6.678-46.834M9.358-47.568Q9.358-48.072 9.614-48.504Q9.870-48.935 10.305-49.187Q10.741-49.439 11.241-49.439Q11.628-49.439 11.969-49.295Q12.311-49.150 12.573-48.889Q12.835-48.627 12.977-48.291Q13.120-47.955 13.120-47.568Q13.120-47.076 12.856-46.666Q12.592-46.256 12.163-46.025Q11.733-45.795 11.241-45.795Q10.749-45.795 10.315-46.027Q9.881-46.260 9.620-46.668Q9.358-47.076 9.358-47.568M11.241-46.072Q11.698-46.072 11.950-46.295Q12.202-46.518 12.290-46.869Q12.378-47.221 12.378-47.666Q12.378-48.096 12.284-48.434Q12.190-48.771 11.936-48.978Q11.682-49.185 11.241-49.185Q10.592-49.185 10.348-48.769Q10.104-48.353 10.104-47.666Q10.104-47.221 10.192-46.869Q10.280-46.518 10.532-46.295Q10.784-46.072 11.241-46.072M15.487-44.322L13.631-44.322L13.631-44.615Q13.901-44.615 14.069-44.660Q14.237-44.705 14.237-44.881L14.237-48.705Q14.237-48.912 14.081-48.965Q13.924-49.018 13.631-49.018L13.631-49.314L14.854-49.400L14.854-48.935Q15.085-49.158 15.399-49.279Q15.713-49.400 16.053-49.400Q16.526-49.400 16.930-49.154Q17.335-48.908 17.567-48.492Q17.799-48.076 17.799-47.600Q17.799-47.225 17.651-46.896Q17.503-46.568 17.233-46.316Q16.963-46.064 16.620-45.930Q16.276-45.795 15.917-45.795Q15.628-45.795 15.356-45.916Q15.085-46.037 14.878-46.248L14.878-44.881Q14.878-44.705 15.045-44.660Q15.213-44.615 15.487-44.615L15.487-44.322M14.878-48.537L14.878-46.697Q15.030-46.408 15.292-46.228Q15.553-46.049 15.862-46.049Q16.147-46.049 16.370-46.187Q16.592-46.326 16.745-46.557Q16.897-46.787 16.975-47.059Q17.053-47.330 17.053-47.600Q17.053-47.932 16.928-48.289Q16.803-48.646 16.555-48.883Q16.307-49.119 15.960-49.119Q15.635-49.119 15.340-48.963Q15.045-48.807 14.878-48.537M20.436-47.322L18.182-47.322L18.182-47.873L20.436-47.873L20.436-47.322M22.971-45.795Q22.491-45.795 22.083-46.039Q21.674-46.283 21.436-46.697Q21.198-47.111 21.198-47.600Q21.198-48.092 21.456-48.508Q21.713-48.924 22.145-49.162Q22.577-49.400 23.069-49.400Q23.690-49.400 24.139-48.963L24.139-50.592Q24.139-50.807 24.077-50.902Q24.014-50.998 23.897-51.019Q23.780-51.041 23.534-51.041L23.534-51.338L24.756-51.424L24.756-46.615Q24.756-46.404 24.819-46.309Q24.881-46.213 24.999-46.191Q25.116-46.170 25.366-46.170L25.366-45.873L24.116-45.795L24.116-46.279Q23.651-45.795 22.971-45.795M23.038-46.049Q23.378-46.049 23.670-46.240Q23.963-46.432 24.116-46.728L24.116-48.560Q23.967-48.834 23.706-48.990Q23.444-49.146 23.131-49.146Q22.506-49.146 22.223-48.699Q21.940-48.252 21.940-47.592Q21.940-46.947 22.192-46.498Q22.444-46.049 23.038-46.049M25.874-47.568Q25.874-48.072 26.129-48.504Q26.385-48.935 26.821-49.187Q27.256-49.439 27.756-49.439Q28.143-49.439 28.485-49.295Q28.827-49.150 29.088-48.889Q29.350-48.627 29.493-48.291Q29.635-47.955 29.635-47.568Q29.635-47.076 29.372-46.666Q29.108-46.256 28.678-46.025Q28.249-45.795 27.756-45.795Q27.264-45.795 26.831-46.027Q26.397-46.260 26.135-46.668Q25.874-47.076 25.874-47.568M27.756-46.072Q28.213-46.072 28.465-46.295Q28.717-46.518 28.805-46.869Q28.893-47.221 28.893-47.666Q28.893-48.096 28.799-48.434Q28.706-48.771 28.452-48.978Q28.198-49.185 27.756-49.185Q27.108-49.185 26.864-48.769Q26.620-48.353 26.620-47.666Q26.620-47.221 26.708-46.869Q26.795-46.518 27.047-46.295Q27.299-46.072 27.756-46.072",[955],[938,2787,2788],{"transform":2781},[545,2789],{"d":2790,"fill":940,"stroke":940,"className":2791,"style":2626},"M31.486-45.904L30.416-48.760Q30.349-48.939 30.219-48.982Q30.088-49.025 29.830-49.025L29.830-49.322L31.510-49.322L31.510-49.025Q31.060-49.025 31.060-48.826Q31.064-48.810 31.066-48.793Q31.068-48.775 31.068-48.760L31.861-46.666L32.572-48.576Q32.537-48.670 32.537-48.715Q32.537-48.760 32.502-48.760Q32.435-48.939 32.305-48.982Q32.174-49.025 31.920-49.025L31.920-49.322L33.510-49.322L33.510-49.025Q33.060-49.025 33.060-48.826Q33.064-48.807 33.066-48.789Q33.068-48.771 33.068-48.760L33.900-46.545L34.654-48.545Q34.678-48.603 34.678-48.674Q34.678-48.834 34.541-48.930Q34.404-49.025 34.236-49.025L34.236-49.322L35.623-49.322L35.623-49.025Q35.389-49.025 35.211-48.898Q35.033-48.771 34.951-48.545L33.967-45.904Q33.912-45.795 33.799-45.795L33.740-45.795Q33.627-45.795 33.584-45.904L32.724-48.178L31.869-45.904Q31.830-45.795 31.709-45.795L31.654-45.795Q31.541-45.795 31.486-45.904M37.967-45.873L36.111-45.873L36.111-46.170Q36.385-46.170 36.553-46.217Q36.721-46.264 36.721-46.432L36.721-48.568Q36.721-48.783 36.658-48.879Q36.596-48.975 36.476-48.996Q36.357-49.018 36.111-49.018L36.111-49.314L37.303-49.400L37.303-48.666Q37.416-48.881 37.609-49.049Q37.803-49.217 38.041-49.309Q38.279-49.400 38.533-49.400Q39.701-49.400 39.701-48.322L39.701-46.432Q39.701-46.264 39.871-46.217Q40.041-46.170 40.310-46.170L40.310-45.873L38.455-45.873L38.455-46.170Q38.728-46.170 38.896-46.217Q39.064-46.264 39.064-46.432L39.064-48.307Q39.064-48.689 38.943-48.918Q38.822-49.146 38.471-49.146Q38.158-49.146 37.904-48.984Q37.650-48.822 37.504-48.553Q37.357-48.283 37.357-47.986L37.357-46.432Q37.357-46.264 37.527-46.217Q37.697-46.170 37.967-46.170",[955],[545,2793],{"fill":944,"d":2794},"M-6.989 26.681h25.607V1.074H-6.989Z",[938,2796,2798],{"transform":2797},"translate(-2.312 62.65)",[545,2799],{"d":2641,"fill":940,"stroke":940,"className":2800,"style":1965},[955],[545,2802],{"fill":944,"d":2803},"M21.464 26.681H47.07V1.074H21.464Z",[938,2805,2807],{"transform":2806},"translate(26.14 62.65)",[545,2808],{"d":2651,"fill":940,"stroke":940,"className":2809,"style":1965},[955],[545,2811],{"fill":944,"d":2812},"M49.917 26.681h25.607V1.074H49.917Z",[938,2814,2816],{"transform":2815},"translate(54.593 62.65)",[545,2817],{"d":2651,"fill":940,"stroke":940,"className":2818,"style":1965},[955],[545,2820],{"fill":944,"d":2821},"M78.37 26.681h25.607V1.074H78.369Z",[938,2823,2825],{"transform":2824},"translate(83.046 62.65)",[545,2826],{"d":2670,"fill":940,"stroke":940,"className":2827,"style":1965},[955],[545,2829],{"fill":944,"d":2830},"M106.822 26.681h25.607V1.074h-25.607Z",[938,2832,2834],{"transform":2833},"translate(111.498 62.65)",[545,2835],{"d":2680,"fill":940,"stroke":940,"className":2836,"style":1965},[955],[545,2838],{"fill":944,"d":2839},"M135.275 26.681h25.607V1.074h-25.607Z",[938,2841,2843],{"transform":2842},"translate(139.951 62.65)",[545,2844],{"d":2690,"fill":940,"stroke":940,"className":2845,"style":1965},[955],[938,2847,2848,2851,2854],{"fill":2736,"stroke":2736,"style":2737},[545,2849],{"fill":944,"d":2850},"M163.728 31.518H-5.71",[545,2852],{"d":2853},"m-8.695 31.518 4.169 1.577-1.383-1.577 1.383-1.576Z",[938,2855,2856,2863,2869,2875,2881,2887],{"fill":2736,"stroke":944,"fontFamily":2617,"fontSize":2618},[938,2857,2859],{"transform":2858},"translate(18.32 86.68)",[545,2860],{"d":2861,"fill":2736,"stroke":2736,"className":2862,"style":2626},"M8.061-45.873L6.081-45.873L6.081-46.170Q6.350-46.170 6.518-46.215Q6.686-46.260 6.686-46.432L6.686-48.568Q6.686-48.783 6.624-48.879Q6.561-48.975 6.444-48.996Q6.327-49.018 6.081-49.018L6.081-49.314L7.249-49.400L7.249-48.615Q7.327-48.826 7.479-49.012Q7.631-49.197 7.831-49.299Q8.030-49.400 8.256-49.400Q8.503-49.400 8.694-49.256Q8.885-49.111 8.885-48.881Q8.885-48.725 8.780-48.615Q8.674-48.506 8.518-48.506Q8.362-48.506 8.253-48.615Q8.143-48.725 8.143-48.881Q8.143-49.041 8.249-49.146Q7.924-49.146 7.710-48.918Q7.495-48.689 7.399-48.350Q7.303-48.010 7.303-47.705L7.303-46.432Q7.303-46.264 7.530-46.217Q7.756-46.170 8.061-46.170L8.061-45.873M9.366-47.627Q9.366-48.107 9.598-48.523Q9.831-48.939 10.241-49.189Q10.651-49.439 11.128-49.439Q11.858-49.439 12.256-48.998Q12.655-48.557 12.655-47.826Q12.655-47.721 12.561-47.697L10.112-47.697L10.112-47.627Q10.112-47.217 10.233-46.861Q10.354-46.506 10.626-46.289Q10.897-46.072 11.327-46.072Q11.690-46.072 11.987-46.301Q12.284-46.529 12.385-46.881Q12.393-46.928 12.479-46.943L12.561-46.943Q12.655-46.916 12.655-46.834Q12.655-46.826 12.647-46.795Q12.585-46.568 12.446-46.385Q12.307-46.201 12.116-46.068Q11.924-45.935 11.706-45.865Q11.487-45.795 11.249-45.795Q10.878-45.795 10.540-45.932Q10.202-46.068 9.934-46.320Q9.667-46.572 9.516-46.912Q9.366-47.252 9.366-47.627M10.120-47.935L12.081-47.935Q12.081-48.240 11.979-48.531Q11.878-48.822 11.661-49.004Q11.444-49.185 11.128-49.185Q10.827-49.185 10.596-48.998Q10.366-48.810 10.243-48.519Q10.120-48.228 10.120-47.935M13.186-47.600Q13.186-48.096 13.436-48.521Q13.686-48.947 14.106-49.193Q14.526-49.439 15.026-49.439Q15.565-49.439 15.956-49.314Q16.346-49.189 16.346-48.775Q16.346-48.670 16.295-48.578Q16.245-48.486 16.153-48.435Q16.061-48.385 15.952-48.385Q15.846-48.385 15.754-48.435Q15.663-48.486 15.612-48.578Q15.561-48.670 15.561-48.775Q15.561-48.998 15.729-49.103Q15.506-49.162 15.034-49.162Q14.737-49.162 14.522-49.023Q14.307-48.885 14.176-48.654Q14.045-48.424 13.987-48.154Q13.928-47.885 13.928-47.600Q13.928-47.205 14.061-46.855Q14.194-46.506 14.465-46.289Q14.737-46.072 15.135-46.072Q15.510-46.072 15.786-46.289Q16.061-46.506 16.163-46.865Q16.178-46.928 16.241-46.928L16.346-46.928Q16.381-46.928 16.407-46.900Q16.432-46.873 16.432-46.834L16.432-46.810Q16.299-46.330 15.915-46.062Q15.530-45.795 15.026-45.795Q14.663-45.795 14.329-45.932Q13.995-46.068 13.735-46.318Q13.475-46.568 13.331-46.904Q13.186-47.240 13.186-47.600M17.604-46.826L17.604-48.568Q17.604-48.783 17.542-48.879Q17.479-48.975 17.360-48.996Q17.241-49.018 16.995-49.018L16.995-49.314L18.241-49.400L18.241-46.850L18.241-46.826Q18.241-46.514 18.295-46.352Q18.350-46.189 18.501-46.119Q18.651-46.049 18.971-46.049Q19.401-46.049 19.674-46.387Q19.948-46.725 19.948-47.170L19.948-48.568Q19.948-48.783 19.885-48.879Q19.823-48.975 19.704-48.996Q19.585-49.018 19.338-49.018L19.338-49.314L20.585-49.400L20.585-46.615Q20.585-46.404 20.647-46.309Q20.710-46.213 20.829-46.191Q20.948-46.170 21.194-46.170L21.194-45.873L19.971-45.795L19.971-46.416Q19.803-46.127 19.522-45.961Q19.241-45.795 18.920-45.795Q17.604-45.795 17.604-46.826M23.647-45.873L21.667-45.873L21.667-46.170Q21.936-46.170 22.104-46.215Q22.272-46.260 22.272-46.432L22.272-48.568Q22.272-48.783 22.210-48.879Q22.147-48.975 22.030-48.996Q21.913-49.018 21.667-49.018L21.667-49.314L22.835-49.400L22.835-48.615Q22.913-48.826 23.065-49.012Q23.217-49.197 23.417-49.299Q23.616-49.400 23.842-49.400Q24.088-49.400 24.280-49.256Q24.471-49.111 24.471-48.881Q24.471-48.725 24.366-48.615Q24.260-48.506 24.104-48.506Q23.948-48.506 23.838-48.615Q23.729-48.725 23.729-48.881Q23.729-49.041 23.835-49.146Q23.510-49.146 23.295-48.918Q23.081-48.689 22.985-48.350Q22.889-48.010 22.889-47.705L22.889-46.432Q22.889-46.264 23.116-46.217Q23.342-46.170 23.647-46.170L23.647-45.873M24.995-45.881L24.995-47.103Q24.995-47.131 25.026-47.162Q25.057-47.193 25.081-47.193L25.186-47.193Q25.256-47.193 25.272-47.131Q25.335-46.810 25.473-46.570Q25.612-46.330 25.844-46.189Q26.077-46.049 26.385-46.049Q26.624-46.049 26.833-46.109Q27.042-46.170 27.178-46.318Q27.315-46.467 27.315-46.713Q27.315-46.967 27.104-47.133Q26.893-47.299 26.624-47.353L26.003-47.467Q25.596-47.545 25.295-47.801Q24.995-48.057 24.995-48.432Q24.995-48.799 25.196-49.021Q25.397-49.244 25.721-49.342Q26.045-49.439 26.385-49.439Q26.850-49.439 27.147-49.232L27.370-49.416Q27.393-49.439 27.424-49.439L27.475-49.439Q27.506-49.439 27.534-49.412Q27.561-49.385 27.561-49.353L27.561-48.369Q27.561-48.338 27.536-48.309Q27.510-48.279 27.475-48.279L27.370-48.279Q27.335-48.279 27.307-48.307Q27.280-48.334 27.280-48.369Q27.280-48.768 27.028-48.988Q26.776-49.209 26.378-49.209Q26.022-49.209 25.739-49.086Q25.456-48.963 25.456-48.658Q25.456-48.439 25.657-48.307Q25.858-48.174 26.104-48.131L26.729-48.018Q27.159-47.928 27.467-47.631Q27.776-47.334 27.776-46.920Q27.776-46.350 27.378-46.072Q26.979-45.795 26.385-45.795Q25.835-45.795 25.483-46.131L25.186-45.818Q25.163-45.795 25.128-45.795L25.081-45.795Q25.057-45.795 25.026-45.826Q24.995-45.857 24.995-45.881M28.303-47.627Q28.303-48.107 28.536-48.523Q28.768-48.939 29.178-49.189Q29.588-49.439 30.065-49.439Q30.795-49.439 31.194-48.998Q31.592-48.557 31.592-47.826Q31.592-47.721 31.499-47.697L29.049-47.697L29.049-47.627Q29.049-47.217 29.170-46.861Q29.292-46.506 29.563-46.289Q29.835-46.072 30.264-46.072Q30.628-46.072 30.924-46.301Q31.221-46.529 31.323-46.881Q31.331-46.928 31.417-46.943L31.499-46.943Q31.592-46.916 31.592-46.834Q31.592-46.826 31.585-46.795Q31.522-46.568 31.383-46.385Q31.245-46.201 31.053-46.068Q30.862-45.935 30.643-45.865Q30.424-45.795 30.186-45.795Q29.815-45.795 29.477-45.932Q29.139-46.068 28.872-46.320Q28.604-46.572 28.454-46.912Q28.303-47.252 28.303-47.627M29.057-47.935L31.018-47.935Q31.018-48.240 30.917-48.531Q30.815-48.822 30.598-49.004Q30.381-49.185 30.065-49.185Q29.764-49.185 29.534-48.998Q29.303-48.810 29.180-48.519Q29.057-48.228 29.057-47.935",[955],[938,2864,2865],{"transform":2858},[545,2866],{"d":2867,"fill":2736,"stroke":2736,"className":2868,"style":2626},"M36.987-45.873L35.002-45.873L35.002-46.170Q35.276-46.170 35.444-46.217Q35.612-46.264 35.612-46.432L35.612-49.025L34.971-49.025L34.971-49.322L35.612-49.322L35.612-50.256Q35.612-50.521 35.729-50.758Q35.846-50.994 36.039-51.158Q36.233-51.322 36.481-51.414Q36.729-51.506 36.995-51.506Q37.280-51.506 37.504-51.348Q37.729-51.189 37.729-50.912Q37.729-50.756 37.623-50.646Q37.518-50.537 37.354-50.537Q37.198-50.537 37.088-50.646Q36.979-50.756 36.979-50.912Q36.979-51.119 37.139-51.225Q37.041-51.248 36.948-51.248Q36.717-51.248 36.545-51.092Q36.373-50.935 36.287-50.699Q36.202-50.463 36.202-50.240L36.202-49.322L37.170-49.322L37.170-49.025L36.225-49.025L36.225-46.432Q36.225-46.264 36.452-46.217Q36.678-46.170 36.987-46.170L36.987-45.873M39.522-45.873L37.541-45.873L37.541-46.170Q37.811-46.170 37.979-46.215Q38.147-46.260 38.147-46.432L38.147-48.568Q38.147-48.783 38.084-48.879Q38.022-48.975 37.905-48.996Q37.787-49.018 37.541-49.018L37.541-49.314L38.709-49.400L38.709-48.615Q38.787-48.826 38.940-49.012Q39.092-49.197 39.291-49.299Q39.491-49.400 39.717-49.400Q39.963-49.400 40.155-49.256Q40.346-49.111 40.346-48.881Q40.346-48.725 40.241-48.615Q40.135-48.506 39.979-48.506Q39.823-48.506 39.713-48.615Q39.604-48.725 39.604-48.881Q39.604-49.041 39.709-49.146Q39.385-49.146 39.170-48.918Q38.955-48.689 38.860-48.350Q38.764-48.010 38.764-47.705L38.764-46.432Q38.764-46.264 38.991-46.217Q39.217-46.170 39.522-46.170L39.522-45.873M40.827-47.568Q40.827-48.072 41.082-48.504Q41.338-48.935 41.774-49.187Q42.209-49.439 42.709-49.439Q43.096-49.439 43.438-49.295Q43.780-49.150 44.041-48.889Q44.303-48.627 44.446-48.291Q44.588-47.955 44.588-47.568Q44.588-47.076 44.325-46.666Q44.061-46.256 43.631-46.025Q43.202-45.795 42.709-45.795Q42.217-45.795 41.784-46.027Q41.350-46.260 41.088-46.668Q40.827-47.076 40.827-47.568M42.709-46.072Q43.166-46.072 43.418-46.295Q43.670-46.518 43.758-46.869Q43.846-47.221 43.846-47.666Q43.846-48.096 43.752-48.434Q43.659-48.771 43.405-48.978Q43.151-49.185 42.709-49.185Q42.061-49.185 41.817-48.769Q41.573-48.353 41.573-47.666Q41.573-47.221 41.661-46.869Q41.748-46.518 42-46.295Q42.252-46.072 42.709-46.072M47.002-45.873L45.147-45.873L45.147-46.170Q45.420-46.170 45.588-46.217Q45.756-46.264 45.756-46.432L45.756-48.568Q45.756-48.783 45.694-48.879Q45.631-48.975 45.512-48.996Q45.393-49.018 45.147-49.018L45.147-49.314L46.338-49.400L46.338-48.666Q46.452-48.881 46.645-49.049Q46.838-49.217 47.077-49.309Q47.315-49.400 47.569-49.400Q48.530-49.400 48.705-48.689Q48.889-49.018 49.217-49.209Q49.545-49.400 49.924-49.400Q51.100-49.400 51.100-48.322L51.100-46.432Q51.100-46.264 51.268-46.217Q51.436-46.170 51.705-46.170L51.705-45.873L49.850-45.873L49.850-46.170Q50.123-46.170 50.291-46.215Q50.459-46.260 50.459-46.432L50.459-48.307Q50.459-48.693 50.334-48.920Q50.209-49.146 49.858-49.146Q49.553-49.146 49.297-48.984Q49.041-48.822 48.893-48.553Q48.745-48.283 48.745-47.986L48.745-46.432Q48.745-46.264 48.914-46.217Q49.084-46.170 49.354-46.170L49.354-45.873L47.498-45.873L47.498-46.170Q47.772-46.170 47.940-46.217Q48.108-46.264 48.108-46.432L48.108-48.307Q48.108-48.693 47.983-48.920Q47.858-49.146 47.506-49.146Q47.202-49.146 46.946-48.984Q46.690-48.822 46.541-48.553Q46.393-48.283 46.393-47.986L46.393-46.432Q46.393-46.264 46.563-46.217Q46.733-46.170 47.002-46.170",[955],[938,2870,2871],{"transform":2858},[545,2872],{"d":2873,"fill":2736,"stroke":2736,"className":2874,"style":2626},"M55.599-46.752L55.536-46.752Q55.677-46.400 56.001-46.189Q56.325-45.978 56.712-45.978Q57.306-45.978 57.556-46.412Q57.806-46.846 57.806-47.482Q57.806-48.076 57.636-48.523Q57.466-48.971 56.966-48.971Q56.669-48.971 56.464-48.891Q56.259-48.810 56.157-48.719Q56.056-48.627 55.941-48.494Q55.825-48.361 55.775-48.346L55.704-48.346Q55.618-48.369 55.599-48.447L55.599-51.096Q55.630-51.193 55.704-51.193Q55.720-51.193 55.728-51.191Q55.736-51.189 55.743-51.185Q56.329-50.935 56.927-50.935Q57.509-50.935 58.126-51.193L58.150-51.193Q58.193-51.193 58.220-51.168Q58.247-51.143 58.247-51.103L58.247-51.025Q58.247-50.994 58.224-50.971Q57.927-50.619 57.505-50.422Q57.083-50.225 56.622-50.225Q56.275-50.225 55.896-50.330L55.896-48.834Q56.114-49.029 56.390-49.127Q56.665-49.225 56.966-49.225Q57.423-49.225 57.792-48.977Q58.161-48.728 58.368-48.324Q58.575-47.920 58.575-47.475Q58.575-46.986 58.320-46.578Q58.064-46.170 57.632-45.937Q57.200-45.705 56.712-45.705Q56.318-45.705 55.962-45.896Q55.607-46.088 55.396-46.422Q55.185-46.756 55.185-47.170Q55.185-47.350 55.302-47.463Q55.419-47.576 55.599-47.576Q55.716-47.576 55.808-47.523Q55.900-47.471 55.952-47.379Q56.005-47.287 56.005-47.170Q56.005-46.986 55.892-46.869Q55.779-46.752 55.599-46.752M59.829-44.467Q59.829-44.490 59.861-44.537Q60.154-44.799 60.320-45.166Q60.486-45.533 60.486-45.920L60.486-45.978Q60.357-45.873 60.189-45.873Q59.997-45.873 59.861-46.006Q59.724-46.139 59.724-46.338Q59.724-46.529 59.861-46.662Q59.997-46.795 60.189-46.795Q60.489-46.795 60.614-46.525Q60.739-46.256 60.739-45.920Q60.739-45.471 60.558-45.057Q60.376-44.643 60.036-44.346Q60.013-44.322 59.974-44.322Q59.927-44.322 59.878-44.367Q59.829-44.412 59.829-44.467",[955],[938,2876,2877],{"transform":2858},[545,2878],{"d":2879,"fill":2736,"stroke":2736,"className":2880,"style":2626},"M66.301-45.873L64.469-45.873L64.469-46.170Q64.738-46.170 64.906-46.215Q65.074-46.260 65.074-46.432L65.074-49.025L64.433-49.025L64.433-49.322L65.074-49.322L65.074-50.256Q65.074-50.670 65.383-50.951Q65.691-51.232 66.137-51.369Q66.582-51.506 66.988-51.506Q67.391-51.506 67.709-51.279Q68.027-51.053 68.027-50.666Q68.027-50.490 67.914-50.377Q67.801-50.264 67.629-50.264Q67.453-50.264 67.340-50.377Q67.226-50.490 67.226-50.666Q67.226-50.810 67.316-50.920Q67.406-51.029 67.539-51.057Q67.254-51.248 66.906-51.248Q66.609-51.248 66.322-51.127Q66.035-51.006 65.851-50.773Q65.668-50.541 65.668-50.240L65.668-49.322L66.820-49.322L68.043-49.416L68.043-46.432Q68.043-46.264 68.211-46.217Q68.379-46.170 68.652-46.170L68.652-45.873L66.820-45.873L66.820-46.170Q67.090-46.170 67.258-46.215Q67.426-46.260 67.426-46.432L67.426-48.592Q67.426-48.799 67.379-48.898Q67.332-48.998 67.156-49.025L65.691-49.025L65.691-46.432Q65.691-46.264 65.859-46.217Q66.027-46.170 66.301-46.170L66.301-45.873M71.074-45.873L69.242-45.873L69.242-46.170Q69.516-46.170 69.683-46.217Q69.851-46.264 69.851-46.432L69.851-50.592Q69.851-50.807 69.789-50.902Q69.726-50.998 69.607-51.019Q69.488-51.041 69.242-51.041L69.242-51.338L70.465-51.424L70.465-46.432Q70.465-46.264 70.633-46.217Q70.801-46.170 71.074-46.170L71.074-45.873M73.433-45.873L71.601-45.873L71.601-46.170Q71.875-46.170 72.043-46.217Q72.211-46.264 72.211-46.432L72.211-50.592Q72.211-50.807 72.148-50.902Q72.086-50.998 71.967-51.019Q71.848-51.041 71.601-51.041L71.601-51.338L72.824-51.424L72.824-46.432Q72.824-46.264 72.992-46.217Q73.160-46.170 73.433-46.170",[955],[938,2882,2883],{"transform":2858},[545,2884],{"d":2885,"fill":2736,"stroke":2736,"className":2886,"style":2626},"M76.719-47.568Q76.719-48.072 76.975-48.504Q77.231-48.935 77.667-49.187Q78.102-49.439 78.602-49.439Q78.989-49.439 79.331-49.295Q79.672-49.150 79.934-48.889Q80.196-48.627 80.338-48.291Q80.481-47.955 80.481-47.568Q80.481-47.076 80.217-46.666Q79.954-46.256 79.524-46.025Q79.094-45.795 78.602-45.795Q78.110-45.795 77.676-46.027Q77.243-46.260 76.981-46.668Q76.719-47.076 76.719-47.568M78.602-46.072Q79.059-46.072 79.311-46.295Q79.563-46.518 79.651-46.869Q79.739-47.221 79.739-47.666Q79.739-48.096 79.645-48.434Q79.551-48.771 79.297-48.978Q79.043-49.185 78.602-49.185Q77.954-49.185 77.710-48.769Q77.465-48.353 77.465-47.666Q77.465-47.221 77.553-46.869Q77.641-46.518 77.893-46.295Q78.145-46.072 78.602-46.072M82.895-45.873L81.040-45.873L81.040-46.170Q81.313-46.170 81.481-46.217Q81.649-46.264 81.649-46.432L81.649-48.568Q81.649-48.783 81.586-48.879Q81.524-48.975 81.405-48.996Q81.286-49.018 81.040-49.018L81.040-49.314L82.231-49.400L82.231-48.666Q82.344-48.881 82.538-49.049Q82.731-49.217 82.969-49.309Q83.208-49.400 83.461-49.400Q84.629-49.400 84.629-48.322L84.629-46.432Q84.629-46.264 84.799-46.217Q84.969-46.170 85.239-46.170L85.239-45.873L83.383-45.873L83.383-46.170Q83.657-46.170 83.825-46.217Q83.993-46.264 83.993-46.432L83.993-48.307Q83.993-48.689 83.872-48.918Q83.751-49.146 83.399-49.146Q83.086-49.146 82.833-48.984Q82.579-48.822 82.432-48.553Q82.286-48.283 82.286-47.986L82.286-46.432Q82.286-46.264 82.456-46.217Q82.626-46.170 82.895-46.170",[955],[938,2888,2889],{"transform":2858},[545,2890],{"d":2891,"fill":2736,"stroke":2736,"className":2892,"style":2626},"M90.533-45.873L88.553-45.873L88.553-46.170Q88.822-46.170 88.990-46.215Q89.158-46.260 89.158-46.432L89.158-48.568Q89.158-48.783 89.096-48.879Q89.033-48.975 88.916-48.996Q88.799-49.018 88.553-49.018L88.553-49.314L89.721-49.400L89.721-48.615Q89.799-48.826 89.951-49.012Q90.103-49.197 90.303-49.299Q90.502-49.400 90.728-49.400Q90.975-49.400 91.166-49.256Q91.357-49.111 91.357-48.881Q91.357-48.725 91.252-48.615Q91.146-48.506 90.990-48.506Q90.834-48.506 90.725-48.615Q90.615-48.725 90.615-48.881Q90.615-49.041 90.721-49.146Q90.396-49.146 90.182-48.918Q89.967-48.689 89.871-48.350Q89.775-48.010 89.775-47.705L89.775-46.432Q89.775-46.264 90.002-46.217Q90.228-46.170 90.533-46.170L90.533-45.873M91.838-47.627Q91.838-48.107 92.070-48.523Q92.303-48.939 92.713-49.189Q93.123-49.439 93.600-49.439Q94.330-49.439 94.728-48.998Q95.127-48.557 95.127-47.826Q95.127-47.721 95.033-47.697L92.584-47.697L92.584-47.627Q92.584-47.217 92.705-46.861Q92.826-46.506 93.098-46.289Q93.369-46.072 93.799-46.072Q94.162-46.072 94.459-46.301Q94.756-46.529 94.857-46.881Q94.865-46.928 94.951-46.943L95.033-46.943Q95.127-46.916 95.127-46.834Q95.127-46.826 95.119-46.795Q95.057-46.568 94.918-46.385Q94.779-46.201 94.588-46.068Q94.396-45.935 94.178-45.865Q93.959-45.795 93.721-45.795Q93.350-45.795 93.012-45.932Q92.674-46.068 92.406-46.320Q92.139-46.572 91.988-46.912Q91.838-47.252 91.838-47.627M92.592-47.935L94.553-47.935Q94.553-48.240 94.451-48.531Q94.350-48.822 94.133-49.004Q93.916-49.185 93.600-49.185Q93.299-49.185 93.068-48.998Q92.838-48.810 92.715-48.519Q92.592-48.228 92.592-47.935M96.240-46.834L96.240-49.025L95.537-49.025L95.537-49.279Q95.892-49.279 96.135-49.512Q96.377-49.744 96.488-50.092Q96.600-50.439 96.600-50.795L96.881-50.795L96.881-49.322L98.057-49.322L98.057-49.025L96.881-49.025L96.881-46.850Q96.881-46.529 97-46.301Q97.119-46.072 97.400-46.072Q97.580-46.072 97.697-46.195Q97.814-46.318 97.867-46.498Q97.920-46.678 97.920-46.850L97.920-47.322L98.201-47.322L98.201-46.834Q98.201-46.580 98.096-46.340Q97.990-46.100 97.793-45.947Q97.596-45.795 97.338-45.795Q97.021-45.795 96.769-45.918Q96.517-46.041 96.379-46.275Q96.240-46.510 96.240-46.834M99.603-46.826L99.603-48.568Q99.603-48.783 99.541-48.879Q99.478-48.975 99.359-48.996Q99.240-49.018 98.994-49.018L98.994-49.314L100.240-49.400L100.240-46.850L100.240-46.826Q100.240-46.514 100.295-46.352Q100.350-46.189 100.500-46.119Q100.650-46.049 100.971-46.049Q101.400-46.049 101.674-46.387Q101.947-46.725 101.947-47.170L101.947-48.568Q101.947-48.783 101.885-48.879Q101.822-48.975 101.703-48.996Q101.584-49.018 101.338-49.018L101.338-49.314L102.584-49.400L102.584-46.615Q102.584-46.404 102.646-46.309Q102.709-46.213 102.828-46.191Q102.947-46.170 103.193-46.170L103.193-45.873L101.971-45.795L101.971-46.416Q101.803-46.127 101.521-45.961Q101.240-45.795 100.920-45.795Q99.603-45.795 99.603-46.826M105.646-45.873L103.666-45.873L103.666-46.170Q103.935-46.170 104.103-46.215Q104.271-46.260 104.271-46.432L104.271-48.568Q104.271-48.783 104.209-48.879Q104.146-48.975 104.029-48.996Q103.912-49.018 103.666-49.018L103.666-49.314L104.834-49.400L104.834-48.615Q104.912-48.826 105.064-49.012Q105.217-49.197 105.416-49.299Q105.615-49.400 105.842-49.400Q106.088-49.400 106.279-49.256Q106.471-49.111 106.471-48.881Q106.471-48.725 106.365-48.615Q106.260-48.506 106.103-48.506Q105.947-48.506 105.838-48.615Q105.728-48.725 105.728-48.881Q105.728-49.041 105.834-49.146Q105.510-49.146 105.295-48.918Q105.080-48.689 104.984-48.350Q104.889-48.010 104.889-47.705L104.889-46.432Q104.889-46.264 105.115-46.217Q105.342-46.170 105.646-46.170L105.646-45.873M108.881-45.873L107.025-45.873L107.025-46.170Q107.299-46.170 107.467-46.217Q107.635-46.264 107.635-46.432L107.635-48.568Q107.635-48.783 107.572-48.879Q107.510-48.975 107.391-48.996Q107.271-49.018 107.025-49.018L107.025-49.314L108.217-49.400L108.217-48.666Q108.330-48.881 108.523-49.049Q108.717-49.217 108.955-49.309Q109.193-49.400 109.447-49.400Q110.615-49.400 110.615-48.322L110.615-46.432Q110.615-46.264 110.785-46.217Q110.955-46.170 111.225-46.170L111.225-45.873L109.369-45.873L109.369-46.170Q109.642-46.170 109.810-46.217Q109.978-46.264 109.978-46.432L109.978-48.307Q109.978-48.689 109.857-48.918Q109.736-49.146 109.385-49.146Q109.072-49.146 108.818-48.984Q108.564-48.822 108.418-48.553Q108.271-48.283 108.271-47.986L108.271-46.432Q108.271-46.264 108.441-46.217Q108.611-46.170 108.881-46.170",[955],[1197,2894,2896,2897,2924,2925,392],{"className":2895},[1200],"Top-down and bottom-up fill the same table ",[421,2898,2900],{"className":2899},[428],[421,2901,2903],{"className":2902,"ariaHidden":433},[432],[421,2904,2906,2909,2912,2916,2920],{"className":2905},[437],[421,2907],{"className":2908,"style":442},[441],[421,2910,449],{"className":2911,"style":448},[446,447],[421,2913,2915],{"className":2914},[453],"[",[421,2917,2919],{"className":2918},[446],"0..5",[421,2921,2923],{"className":2922},[462],"]"," in opposite orders, yet produce identical values ",[421,2926,2928],{"className":2927},[428],[421,2929,2931],{"className":2930,"ariaHidden":433},[432],[421,2932,2934,2937,2940,2943,2946,2949,2952,2955,2958,2961,2964,2967,2970,2973,2976,2979,2982],{"className":2933},[437],[421,2935],{"className":2936,"style":2500},[441],[421,2938,632],{"className":2939},[446],[421,2941,780],{"className":2942},[779],[421,2944],{"className":2945,"style":1715},[467],[421,2947,403],{"className":2948},[446],[421,2950,780],{"className":2951},[779],[421,2953],{"className":2954,"style":1715},[467],[421,2956,403],{"className":2957},[446],[421,2959,780],{"className":2960},[779],[421,2962],{"className":2963,"style":1715},[467],[421,2965,712],{"className":2966},[446],[421,2968,780],{"className":2969},[779],[421,2971],{"className":2972,"style":1715},[467],[421,2974,1280],{"className":2975},[446],[421,2977,780],{"className":2978},[779],[421,2980],{"className":2981,"style":1715},[467],[421,2983,921],{"className":2984},[446],[2986,2987,2989],"callout",{"type":2988},"remark",[381,2990,2991,2994,2995,2998,2999,3001,3002,3027,3028,3052],{},[384,2992,2993],{},"Remark (Top-down vs bottom-up)."," Top-down and bottom-up compute ",[389,2996,2997],{},"exactly the same values"," and have the ",[389,3000,2549],{},"\nasymptotic running time. Memoization solves only the subproblems actually\nreachable from the top, which can be a win when many subproblems are\nirrelevant; tabulation has lower constant-factor overhead and often exposes a\nspace optimization. For Fibonacci, since ",[421,3003,3005],{"className":3004},[428],[421,3006,3008],{"className":3007,"ariaHidden":433},[432],[421,3009,3011,3014,3017,3020,3024],{"className":3010},[437],[421,3012],{"className":3013,"style":442},[441],[421,3015,449],{"className":3016,"style":448},[446,447],[421,3018,2915],{"className":3019},[453],[421,3021,3023],{"className":3022},[446,447],"i",[421,3025,2923],{"className":3026},[462]," depends only on the previous\ntwo entries, the table can shrink to two scalars, giving ",[421,3029,3031],{"className":3030},[428],[421,3032,3034],{"className":3033,"ariaHidden":433},[432],[421,3035,3037,3040,3043,3046,3049],{"className":3036},[437],[421,3038],{"className":3039,"style":442},[441],[421,3041,1362],{"className":3042},[446],[421,3044,454],{"className":3045},[453],[421,3047,403],{"className":3048},[446],[421,3050,463],{"className":3051},[462]," space.",[413,3054,3056],{"id":3055},"the-two-conditions-that-make-dp-work","The two conditions that make DP work",[381,3058,3059,3060,3063],{},"Dynamic programming is not a universal hammer. It applies precisely when a\nproblem has ",[384,3061,3062],{},"two"," structural properties, both emphasized by all three texts.",[381,3065,3066,3069,3070,3072,3073,3076],{},[384,3067,3068],{},"1. Overlapping subproblems."," The recursive solution revisits the same\nsubproblems repeatedly; there are only polynomially many ",[389,3071,1683],{}," ones, even\nthough the naive recursion calls them exponentially often. This is what makes\ncaching pay off. (Contrast divide-and-conquer like merge sort, where each\nrecursive call is on a ",[389,3074,3075],{},"fresh"," subproblem; there is nothing to cache, so\nmemoization buys nothing.)",[381,3078,3079,3082,3083],{},[384,3080,3081],{},"2. Optimal substructure."," An optimal solution to the problem is built from\noptimal solutions to its subproblems. This is what lets us write a recurrence at\nall: we can express the best answer for an instance in terms of the best answers\nfor smaller instances. CLRS states the test sharply: cut an optimal solution at\nsome choice point; the piece that remains must itself be an optimal solution to\nthe residual subproblem, or we could splice in a better piece and improve the\nwhole, a contradiction.",[394,3084,3085],{},[397,3086,1280],{"href":3087,"ariaDescribedBy":3088,"dataFootnoteRef":376,"id":3089},"#user-content-fn-clrs-dp",[401],"user-content-fnref-clrs-dp",[2986,3091,3093],{"type":3092},"lemma",[381,3094,3095,3098],{},[384,3096,3097],{},"Fact (When DP applies)."," When both hold, dynamic programming applies. When optimal substructure fails,\nno recurrence over subproblems can be correct; when subproblems do not overlap,\nplain divide-and-conquer is already efficient and DP adds only overhead.",[413,3100,3102],{"id":3101},"the-dynamic-programming-recipe","The dynamic-programming recipe",[381,3104,3105,3106,3109,3110,3113],{},"DP is a ",[389,3107,3108],{},"design discipline",", not a bag of tricks. The method distils into an\nexplicit checklist, the ",[384,3111,3112],{},"key steps in a DP solution",", and every example\nfollows the same order. Following it turns a moment of insight into a\nroutine you can execute.",[3115,3116,3117,3135,3174,3232,3241,3250,3258,3267],"ol",{},[3118,3119,3120,1680,3123,3126,3127,3130,3131,3134],"li",{},[384,3121,3122],{},"Identify a simplified goal",[389,3124,3125],{},"(maybe)",". Often the original problem asks for an\noptimal ",[389,3128,3129],{},"object"," (the actual set of cuts, the actual chosen intervals). First\nsolve the easier problem of computing only the optimal ",[389,3132,3133],{},"value","; recovering the\nobject is a separate, usually short, step at the end.",[3118,3136,3137,3140,3141,3173],{},[384,3138,3139],{},"Clearly define the subproblems; set up notation."," State precisely what\nquantity ",[421,3142,3144],{"className":3143},[428],[421,3145,3147],{"className":3146,"ariaHidden":433},[432],[421,3148,3150,3153,3163,3166,3170],{"className":3149},[437],[421,3151],{"className":3152,"style":442},[441],[421,3154,3156],{"className":3155},[1582,1583],[421,3157,3159],{"className":3158},[446,756],[421,3160,3162],{"className":3161},[446],"Opt",[421,3164,454],{"className":3165},[453],[421,3167,3169],{"className":3168},[446],"⋅",[421,3171,463],{"className":3172},[462]," denotes, in one English sentence, and which\ncall gives the final answer. This is the single hardest and most important\nstep. Get the subproblem definition right and everything else follows; get it\nwrong and nothing will.",[3118,3175,3176,3179,3180,3201,3202,3223,3224,3227,3228,3231],{},[384,3177,3178],{},"Write the DP equations."," Express ",[421,3181,3183],{"className":3182},[428],[421,3184,3186],{"className":3185,"ariaHidden":433},[432],[421,3187,3189,3192],{"className":3188},[437],[421,3190],{"className":3191,"style":2322},[441],[421,3193,3195],{"className":3194},[1582,1583],[421,3196,3198],{"className":3197},[446,756],[421,3199,3162],{"className":3200},[446]," of a subproblem in terms of\n",[421,3203,3205],{"className":3204},[428],[421,3206,3208],{"className":3207,"ariaHidden":433},[432],[421,3209,3211,3214],{"className":3210},[437],[421,3212],{"className":3213,"style":2322},[441],[421,3215,3217],{"className":3216},[1582,1583],[421,3218,3220],{"className":3219},[446,756],[421,3221,3162],{"className":3222},[446]," of ",[389,3225,3226],{},"smaller"," subproblems, together with the base case(s). This is\nwhere ",[384,3229,3230],{},"optimal substructure"," is used: enumerate the choices an optimal\nsolution could make at its first decision point and take the best.",[3118,3233,3234,1680,3237,3240],{},[384,3235,3236],{},"Prove correctness of the equations",[389,3238,3239],{},"(induction, usually)",". Argue by\ninduction on subproblem size that the equation computes exactly the quantity\nthe definition names.",[3118,3242,3243,1680,3246,3249],{},[384,3244,3245],{},"Write the pseudocode",[389,3247,3248],{},"(be iterative!)",". Turn the equations into a bottom-up\nloop that fills a table in an order respecting the dependencies.",[3118,3251,3252,1680,3255,3257],{},[384,3253,3254],{},"Get back to the original goal",[389,3256,3125],{},". If a simplified goal was used,\nreconstruct the optimal object, either by storing the winning choice at each\nentry, or by tracing back through the filled table.",[3118,3259,3260,1680,3263,3266],{},[384,3261,3262],{},"Argue correctness of the pseudocode",[389,3264,3265],{},"(usually very short)",": it faithfully\nevaluates the equations in a valid order.",[3118,3268,3269,3272,3273,3276,3277,3280],{},[384,3270,3271],{},"Analyze the running time."," Almost mechanical: it is the ",[384,3274,3275],{},"number of\nsubproblems"," times the ",[384,3278,3279],{},"work per subproblem"," (the time to evaluate one line\nof the recurrence).",[381,3282,3283,3284,3287,3288,392],{},"The rest of this lesson runs the recipe end-to-end on two opening examples:\nfirst ",[384,3285,3286],{},"weighted interval scheduling",", then ",[384,3289,3290],{},"rod cutting",[413,3292,3294],{"id":3293},"a-worked-optimization-weighted-interval-scheduling","A worked optimization: weighted interval scheduling",[381,3296,3297,3298,3301,3302,3305,3306,3309],{},"Fibonacci shows the speedup but hides the ",[389,3299,3300],{},"optimization"," flavor that gives DP its\nreal power. The first optimization example is ",[384,3303,3304],{},"weighted interval\nscheduling",", which sharpens the ",[397,3307,3308],{"href":211},"greedy interval-scheduling problem"," you have\nalready met: now each interval carries a profit, and we want the most profitable\ncompatible set rather than merely the most intervals.",[381,3311,3312,3315,3316,3437,3438,3603,3604,3657,3658,3661,3662,3879,3880,3883,3884,392],{},[384,3313,3314],{},"Input."," Intervals ",[421,3317,3319],{"className":3318},[428],[421,3320,3322],{"className":3321,"ariaHidden":433},[432],[421,3323,3325,3328,3332,3375,3378,3381,3384,3387,3390,3393,3433],{"className":3324},[437],[421,3326],{"className":3327,"style":442},[441],[421,3329,3331],{"className":3330},[453],"⟨",[421,3333,3335,3340],{"className":3334},[446],[421,3336,3339],{"className":3337,"style":3338},[446,447],"margin-right:0.0785em;","I",[421,3341,3343],{"className":3342},[1252],[421,3344,3346,3367],{"className":3345},[499,500],[421,3347,3349,3364],{"className":3348},[504],[421,3350,3352],{"className":3351,"style":1262},[508],[421,3353,3355,3358],{"style":3354},"top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;",[421,3356],{"className":3357,"style":1269},[516],[421,3359,3361],{"className":3360},[1273,1274,1275,1276],[421,3362,403],{"className":3363},[446,1276],[421,3365,588],{"className":3366},[587],[421,3368,3370],{"className":3369},[504],[421,3371,3373],{"className":3372,"style":1290},[508],[421,3374],{},[421,3376,780],{"className":3377},[779],[421,3379],{"className":3380,"style":1715},[467],[421,3382,1737],{"className":3383},[487],[421,3385],{"className":3386,"style":1715},[467],[421,3388,780],{"className":3389},[779],[421,3391],{"className":3392,"style":1715},[467],[421,3394,3396,3399],{"className":3395},[446],[421,3397,3339],{"className":3398,"style":3338},[446,447],[421,3400,3402],{"className":3401},[1252],[421,3403,3405,3425],{"className":3404},[499,500],[421,3406,3408,3422],{"className":3407},[504],[421,3409,3411],{"className":3410,"style":2581},[508],[421,3412,3413,3416],{"style":3354},[421,3414],{"className":3415,"style":1269},[516],[421,3417,3419],{"className":3418},[1273,1274,1275,1276],[421,3420,458],{"className":3421},[446,447,1276],[421,3423,588],{"className":3424},[587],[421,3426,3428],{"className":3427},[504],[421,3429,3431],{"className":3430,"style":1290},[508],[421,3432],{},[421,3434,3436],{"className":3435},[462],"⟩",", each ",[421,3439,3441],{"className":3440},[428],[421,3442,3444,3500],{"className":3443,"ariaHidden":433},[432],[421,3445,3447,3450,3491,3494,3497],{"className":3446},[437],[421,3448],{"className":3449,"style":1242},[441],[421,3451,3453,3456],{"className":3452},[446],[421,3454,3339],{"className":3455,"style":3338},[446,447],[421,3457,3459],{"className":3458},[1252],[421,3460,3462,3483],{"className":3461},[499,500],[421,3463,3465,3480],{"className":3464},[504],[421,3466,3469],{"className":3467,"style":3468},[508],"height:0.3117em;",[421,3470,3471,3474],{"style":3354},[421,3472],{"className":3473,"style":1269},[516],[421,3475,3477],{"className":3476},[1273,1274,1275,1276],[421,3478,3023],{"className":3479},[446,447,1276],[421,3481,588],{"className":3482},[587],[421,3484,3486],{"className":3485},[504],[421,3487,3489],{"className":3488,"style":1290},[508],[421,3490],{},[421,3492],{"className":3493,"style":468},[467],[421,3495,473],{"className":3496},[472],[421,3498],{"className":3499,"style":468},[467],[421,3501,3503,3506,3509,3551,3554,3557,3600],{"className":3502},[437],[421,3504],{"className":3505,"style":442},[441],[421,3507,454],{"className":3508},[453],[421,3510,3512,3516],{"className":3511},[446],[421,3513,3515],{"className":3514},[446,447],"s",[421,3517,3519],{"className":3518},[1252],[421,3520,3522,3543],{"className":3521},[499,500],[421,3523,3525,3540],{"className":3524},[504],[421,3526,3528],{"className":3527,"style":3468},[508],[421,3529,3531,3534],{"style":3530},"top:-2.55em;margin-left:0em;margin-right:0.05em;",[421,3532],{"className":3533,"style":1269},[516],[421,3535,3537],{"className":3536},[1273,1274,1275,1276],[421,3538,3023],{"className":3539},[446,447,1276],[421,3541,588],{"className":3542},[587],[421,3544,3546],{"className":3545},[504],[421,3547,3549],{"className":3548,"style":1290},[508],[421,3550],{},[421,3552,780],{"className":3553},[779],[421,3555],{"className":3556,"style":1715},[467],[421,3558,3560,3565],{"className":3559},[446],[421,3561,3564],{"className":3562,"style":3563},[446,447],"margin-right:0.1076em;","f",[421,3566,3568],{"className":3567},[1252],[421,3569,3571,3592],{"className":3570},[499,500],[421,3572,3574,3589],{"className":3573},[504],[421,3575,3577],{"className":3576,"style":3468},[508],[421,3578,3580,3583],{"style":3579},"top:-2.55em;margin-left:-0.1076em;margin-right:0.05em;",[421,3581],{"className":3582,"style":1269},[516],[421,3584,3586],{"className":3585},[1273,1274,1275,1276],[421,3587,3023],{"className":3588},[446,447,1276],[421,3590,588],{"className":3591},[587],[421,3593,3595],{"className":3594},[504],[421,3596,3598],{"className":3597,"style":1290},[508],[421,3599],{},[421,3601,463],{"className":3602},[462],"\nwith a profit ",[421,3605,3607],{"className":3606},[428],[421,3608,3610],{"className":3609,"ariaHidden":433},[432],[421,3611,3613,3617],{"className":3612},[437],[421,3614],{"className":3615,"style":3616},[441],"height:0.625em;vertical-align:-0.1944em;",[421,3618,3620,3623],{"className":3619},[446],[421,3621,381],{"className":3622},[446,447],[421,3624,3626],{"className":3625},[1252],[421,3627,3629,3649],{"className":3628},[499,500],[421,3630,3632,3646],{"className":3631},[504],[421,3633,3635],{"className":3634,"style":3468},[508],[421,3636,3637,3640],{"style":3530},[421,3638],{"className":3639,"style":1269},[516],[421,3641,3643],{"className":3642},[1273,1274,1275,1276],[421,3644,3023],{"className":3645},[446,447,1276],[421,3647,588],{"className":3648},[587],[421,3650,3652],{"className":3651},[504],[421,3653,3655],{"className":3654,"style":1290},[508],[421,3656],{},". ",[384,3659,3660],{},"Desired output."," A subset ",[421,3663,3665],{"className":3664},[428],[421,3666,3668],{"className":3667,"ariaHidden":433},[432],[421,3669,3671,3675],{"className":3670},[437],[421,3672],{"className":3673,"style":3674},[441],"height:1.0059em;vertical-align:-0.2559em;",[421,3676,3678,3684,3771,3774,3777,3780,3783,3786,3789,3875],{"className":3677},[487],[421,3679,3683],{"className":3680,"style":3682},[453,3681],"delimcenter","top:0em;","{",[421,3685,3687,3690],{"className":3686},[446],[421,3688,3339],{"className":3689,"style":3338},[446,447],[421,3691,3693],{"className":3692},[1252],[421,3694,3696,3762],{"className":3695},[499,500],[421,3697,3699,3759],{"className":3698},[504],[421,3700,3702],{"className":3701,"style":3468},[508],[421,3703,3704,3707],{"style":3354},[421,3705],{"className":3706,"style":1269},[516],[421,3708,3710],{"className":3709},[1273,1274,1275,1276],[421,3711,3713],{"className":3712},[446,1276],[421,3714,3716,3719],{"className":3715},[446,1276],[421,3717,3023],{"className":3718},[446,447,1276],[421,3720,3722],{"className":3721},[1252],[421,3723,3725,3750],{"className":3724},[499,500],[421,3726,3728,3747],{"className":3727},[504],[421,3729,3732],{"className":3730,"style":3731},[508],"height:0.3173em;",[421,3733,3735,3739],{"style":3734},"top:-2.357em;margin-left:0em;margin-right:0.0714em;",[421,3736],{"className":3737,"style":3738},[516],"height:2.5em;",[421,3740,3744],{"className":3741},[1273,3742,3743,1276],"reset-size3","size1",[421,3745,403],{"className":3746},[446,1276],[421,3748,588],{"className":3749},[587],[421,3751,3753],{"className":3752},[504],[421,3754,3757],{"className":3755,"style":3756},[508],"height:0.143em;",[421,3758],{},[421,3760,588],{"className":3761},[587],[421,3763,3765],{"className":3764},[504],[421,3766,3769],{"className":3767,"style":3768},[508],"height:0.2501em;",[421,3770],{},[421,3772,780],{"className":3773},[779],[421,3775],{"className":3776,"style":1715},[467],[421,3778,1737],{"className":3779},[487],[421,3781],{"className":3782,"style":1715},[467],[421,3784,780],{"className":3785},[779],[421,3787],{"className":3788,"style":1715},[467],[421,3790,3792,3795],{"className":3791},[446],[421,3793,3339],{"className":3794,"style":3338},[446,447],[421,3796,3798],{"className":3797},[1252],[421,3799,3801,3866],{"className":3800},[499,500],[421,3802,3804,3863],{"className":3803},[504],[421,3805,3807],{"className":3806,"style":3468},[508],[421,3808,3809,3812],{"style":3354},[421,3810],{"className":3811,"style":1269},[516],[421,3813,3815],{"className":3814},[1273,1274,1275,1276],[421,3816,3818],{"className":3817},[446,1276],[421,3819,3821,3824],{"className":3820},[446,1276],[421,3822,3023],{"className":3823},[446,447,1276],[421,3825,3827],{"className":3826},[1252],[421,3828,3830,3854],{"className":3829},[499,500],[421,3831,3833,3851],{"className":3832},[504],[421,3834,3837],{"className":3835,"style":3836},[508],"height:0.3448em;",[421,3838,3840,3843],{"style":3839},"top:-2.3488em;margin-left:0em;margin-right:0.0714em;",[421,3841],{"className":3842,"style":3738},[516],[421,3844,3846],{"className":3845},[1273,3742,3743,1276],[421,3847,3850],{"className":3848,"style":3849},[446,447,1276],"margin-right:0.0315em;","k",[421,3852,588],{"className":3853},[587],[421,3855,3857],{"className":3856},[504],[421,3858,3861],{"className":3859,"style":3860},[508],"height:0.1512em;",[421,3862],{},[421,3864,588],{"className":3865},[587],[421,3867,3869],{"className":3868},[504],[421,3870,3873],{"className":3871,"style":3872},[508],"height:0.2559em;",[421,3874],{},[421,3876,3878],{"className":3877,"style":3682},[462,3681],"}","\nthat is ",[389,3881,3882],{},"feasible"," (the chosen intervals are pairwise disjoint) and maximizes\n",[421,3885,3887],{"className":3886},[428],[421,3888,3890,3986,4005],{"className":3889,"ariaHidden":433},[432],[421,3891,3893,3897,3977,3980,3983],{"className":3892},[437],[421,3894],{"className":3895,"style":3896},[441],"height:0.8334em;vertical-align:-0.2501em;",[421,3898,3900,3903],{"className":3899},[446],[421,3901,381],{"className":3902},[446,447],[421,3904,3906],{"className":3905},[1252],[421,3907,3909,3969],{"className":3908},[499,500],[421,3910,3912,3966],{"className":3911},[504],[421,3913,3915],{"className":3914,"style":3468},[508],[421,3916,3917,3920],{"style":3530},[421,3918],{"className":3919,"style":1269},[516],[421,3921,3923],{"className":3922},[1273,1274,1275,1276],[421,3924,3926],{"className":3925},[446,1276],[421,3927,3929,3932],{"className":3928},[446,1276],[421,3930,3023],{"className":3931},[446,447,1276],[421,3933,3935],{"className":3934},[1252],[421,3936,3938,3958],{"className":3937},[499,500],[421,3939,3941,3955],{"className":3940},[504],[421,3942,3944],{"className":3943,"style":3731},[508],[421,3945,3946,3949],{"style":3734},[421,3947],{"className":3948,"style":3738},[516],[421,3950,3952],{"className":3951},[1273,3742,3743,1276],[421,3953,403],{"className":3954},[446,1276],[421,3956,588],{"className":3957},[587],[421,3959,3961],{"className":3960},[504],[421,3962,3964],{"className":3963,"style":3756},[508],[421,3965],{},[421,3967,588],{"className":3968},[587],[421,3970,3972],{"className":3971},[504],[421,3973,3975],{"className":3974,"style":3768},[508],[421,3976],{},[421,3978],{"className":3979,"style":666},[467],[421,3981,687],{"className":3982},[670],[421,3984],{"className":3985,"style":666},[467],[421,3987,3989,3992,3996,3999,4002],{"className":3988},[437],[421,3990],{"className":3991,"style":1658},[441],[421,3993,3995],{"className":3994},[487],"⋯",[421,3997],{"className":3998,"style":666},[467],[421,4000,687],{"className":4001},[670],[421,4003],{"className":4004,"style":666},[467],[421,4006,4008,4012],{"className":4007},[437],[421,4009],{"className":4010,"style":4011},[441],"height:0.6864em;vertical-align:-0.2559em;",[421,4013,4015,4018],{"className":4014},[446],[421,4016,381],{"className":4017},[446,447],[421,4019,4021],{"className":4020},[1252],[421,4022,4024,4084],{"className":4023},[499,500],[421,4025,4027,4081],{"className":4026},[504],[421,4028,4030],{"className":4029,"style":3468},[508],[421,4031,4032,4035],{"style":3530},[421,4033],{"className":4034,"style":1269},[516],[421,4036,4038],{"className":4037},[1273,1274,1275,1276],[421,4039,4041],{"className":4040},[446,1276],[421,4042,4044,4047],{"className":4043},[446,1276],[421,4045,3023],{"className":4046},[446,447,1276],[421,4048,4050],{"className":4049},[1252],[421,4051,4053,4073],{"className":4052},[499,500],[421,4054,4056,4070],{"className":4055},[504],[421,4057,4059],{"className":4058,"style":3836},[508],[421,4060,4061,4064],{"style":3839},[421,4062],{"className":4063,"style":3738},[516],[421,4065,4067],{"className":4066},[1273,3742,3743,1276],[421,4068,3850],{"className":4069,"style":3849},[446,447,1276],[421,4071,588],{"className":4072},[587],[421,4074,4076],{"className":4075},[504],[421,4077,4079],{"className":4078,"style":3860},[508],[421,4080],{},[421,4082,588],{"className":4083},[587],[421,4085,4087],{"className":4086},[504],[421,4088,4090],{"className":4089,"style":3872},[508],[421,4091],{},[381,4093,4094,4097,4098,4223],{},[384,4095,4096],{},"Step 1: Simplified goal."," Compute only the maximum achievable profit\n",[421,4099,4101],{"className":4100},[428],[421,4102,4104],{"className":4103,"ariaHidden":433},[432],[421,4105,4107,4110,4119,4122,4162,4165,4168,4171,4174,4177,4180,4220],{"className":4106},[437],[421,4108],{"className":4109,"style":442},[441],[421,4111,4113],{"className":4112},[1582,1583],[421,4114,4116],{"className":4115},[446,756],[421,4117,3162],{"className":4118},[446],[421,4120,454],{"className":4121},[453],[421,4123,4125,4128],{"className":4124},[446],[421,4126,3339],{"className":4127,"style":3338},[446,447],[421,4129,4131],{"className":4130},[1252],[421,4132,4134,4154],{"className":4133},[499,500],[421,4135,4137,4151],{"className":4136},[504],[421,4138,4140],{"className":4139,"style":1262},[508],[421,4141,4142,4145],{"style":3354},[421,4143],{"className":4144,"style":1269},[516],[421,4146,4148],{"className":4147},[1273,1274,1275,1276],[421,4149,403],{"className":4150},[446,1276],[421,4152,588],{"className":4153},[587],[421,4155,4157],{"className":4156},[504],[421,4158,4160],{"className":4159,"style":1290},[508],[421,4161],{},[421,4163,780],{"className":4164},[779],[421,4166],{"className":4167,"style":1715},[467],[421,4169,1737],{"className":4170},[487],[421,4172],{"className":4173,"style":1715},[467],[421,4175,780],{"className":4176},[779],[421,4178],{"className":4179,"style":1715},[467],[421,4181,4183,4186],{"className":4182},[446],[421,4184,3339],{"className":4185,"style":3338},[446,447],[421,4187,4189],{"className":4188},[1252],[421,4190,4192,4212],{"className":4191},[499,500],[421,4193,4195,4209],{"className":4194},[504],[421,4196,4198],{"className":4197,"style":2581},[508],[421,4199,4200,4203],{"style":3354},[421,4201],{"className":4202,"style":1269},[516],[421,4204,4206],{"className":4205},[1273,1274,1275,1276],[421,4207,458],{"className":4208},[446,447,1276],[421,4210,588],{"className":4211},[587],[421,4213,4215],{"className":4214},[504],[421,4216,4218],{"className":4217,"style":1290},[508],[421,4219],{},[421,4221,463],{"className":4222},[462],"; we recover the actual subset afterwards.",[381,4225,4226,4229,4230,4233,4234,4416,4417,4533,4534,4550],{},[384,4227,4228],{},"Step 2: Subproblems and notation."," The key preprocessing move is to ",[384,4231,4232],{},"sort the\nintervals by increasing finish time",", so ",[421,4235,4237],{"className":4236},[428],[421,4238,4240,4296,4351,4370],{"className":4239,"ariaHidden":433},[432],[421,4241,4243,4246,4286,4289,4293],{"className":4242},[437],[421,4244],{"className":4245,"style":1392},[441],[421,4247,4249,4252],{"className":4248},[446],[421,4250,3564],{"className":4251,"style":3563},[446,447],[421,4253,4255],{"className":4254},[1252],[421,4256,4258,4278],{"className":4257},[499,500],[421,4259,4261,4275],{"className":4260},[504],[421,4262,4264],{"className":4263,"style":1262},[508],[421,4265,4266,4269],{"style":3579},[421,4267],{"className":4268,"style":1269},[516],[421,4270,4272],{"className":4271},[1273,1274,1275,1276],[421,4273,403],{"className":4274},[446,1276],[421,4276,588],{"className":4277},[587],[421,4279,4281],{"className":4280},[504],[421,4282,4284],{"className":4283,"style":1290},[508],[421,4285],{},[421,4287],{"className":4288,"style":468},[467],[421,4290,4292],{"className":4291},[472],"≤",[421,4294],{"className":4295,"style":468},[467],[421,4297,4299,4302,4342,4345,4348],{"className":4298},[437],[421,4300],{"className":4301,"style":1392},[441],[421,4303,4305,4308],{"className":4304},[446],[421,4306,3564],{"className":4307,"style":3563},[446,447],[421,4309,4311],{"className":4310},[1252],[421,4312,4314,4334],{"className":4313},[499,500],[421,4315,4317,4331],{"className":4316},[504],[421,4318,4320],{"className":4319,"style":1262},[508],[421,4321,4322,4325],{"style":3579},[421,4323],{"className":4324,"style":1269},[516],[421,4326,4328],{"className":4327},[1273,1274,1275,1276],[421,4329,712],{"className":4330},[446,1276],[421,4332,588],{"className":4333},[587],[421,4335,4337],{"className":4336},[504],[421,4338,4340],{"className":4339,"style":1290},[508],[421,4341],{},[421,4343],{"className":4344,"style":468},[467],[421,4346,4292],{"className":4347},[472],[421,4349],{"className":4350,"style":468},[467],[421,4352,4354,4358,4361,4364,4367],{"className":4353},[437],[421,4355],{"className":4356,"style":4357},[441],"height:0.7719em;vertical-align:-0.136em;",[421,4359,3995],{"className":4360},[487],[421,4362],{"className":4363,"style":468},[467],[421,4365,4292],{"className":4366},[472],[421,4368],{"className":4369,"style":468},[467],[421,4371,4373,4376],{"className":4372},[437],[421,4374],{"className":4375,"style":1392},[441],[421,4377,4379,4382],{"className":4378},[446],[421,4380,3564],{"className":4381,"style":3563},[446,447],[421,4383,4385],{"className":4384},[1252],[421,4386,4388,4408],{"className":4387},[499,500],[421,4389,4391,4405],{"className":4390},[504],[421,4392,4394],{"className":4393,"style":2581},[508],[421,4395,4396,4399],{"style":3579},[421,4397],{"className":4398,"style":1269},[516],[421,4400,4402],{"className":4401},[1273,1274,1275,1276],[421,4403,458],{"className":4404},[446,447,1276],[421,4406,588],{"className":4407},[587],[421,4409,4411],{"className":4410},[504],[421,4412,4414],{"className":4413,"style":1290},[508],[421,4415],{},". Once\nsorted, every subproblem we ever need has the contiguous prefix form\n",[421,4418,4420],{"className":4419},[428],[421,4421,4423],{"className":4422,"ariaHidden":433},[432],[421,4424,4426,4429,4432,4472,4475,4478,4481,4484,4487,4490,4530],{"className":4425},[437],[421,4427],{"className":4428,"style":442},[441],[421,4430,3331],{"className":4431},[453],[421,4433,4435,4438],{"className":4434},[446],[421,4436,3339],{"className":4437,"style":3338},[446,447],[421,4439,4441],{"className":4440},[1252],[421,4442,4444,4464],{"className":4443},[499,500],[421,4445,4447,4461],{"className":4446},[504],[421,4448,4450],{"className":4449,"style":1262},[508],[421,4451,4452,4455],{"style":3354},[421,4453],{"className":4454,"style":1269},[516],[421,4456,4458],{"className":4457},[1273,1274,1275,1276],[421,4459,403],{"className":4460},[446,1276],[421,4462,588],{"className":4463},[587],[421,4465,4467],{"className":4466},[504],[421,4468,4470],{"className":4469,"style":1290},[508],[421,4471],{},[421,4473,780],{"className":4474},[779],[421,4476],{"className":4477,"style":1715},[467],[421,4479,1737],{"className":4480},[487],[421,4482],{"className":4483,"style":1715},[467],[421,4485,780],{"className":4486},[779],[421,4488],{"className":4489,"style":1715},[467],[421,4491,4493,4496],{"className":4492},[446],[421,4494,3339],{"className":4495,"style":3338},[446,447],[421,4497,4499],{"className":4498},[1252],[421,4500,4502,4522],{"className":4501},[499,500],[421,4503,4505,4519],{"className":4504},[504],[421,4506,4508],{"className":4507,"style":3468},[508],[421,4509,4510,4513],{"style":3354},[421,4511],{"className":4512,"style":1269},[516],[421,4514,4516],{"className":4515},[1273,1274,1275,1276],[421,4517,3023],{"className":4518},[446,447,1276],[421,4520,588],{"className":4521},[587],[421,4523,4525],{"className":4524},[504],[421,4526,4528],{"className":4527,"style":1290},[508],[421,4529],{},[421,4531,3436],{"className":4532},[462],", so a single index ",[421,4535,4537],{"className":4536},[428],[421,4538,4540],{"className":4539,"ariaHidden":433},[432],[421,4541,4543,4547],{"className":4542},[437],[421,4544],{"className":4545,"style":4546},[441],"height:0.6595em;",[421,4548,3023],{"className":4549},[446,447]," names it. Define",[421,4552,4554],{"className":4553},[424],[421,4555,4557],{"className":4556},[428],[421,4558,4560,4593],{"className":4559,"ariaHidden":433},[432],[421,4561,4563,4566,4575,4578,4581,4584,4587,4590],{"className":4562},[437],[421,4564],{"className":4565,"style":442},[441],[421,4567,4569],{"className":4568},[1582,1583],[421,4570,4572],{"className":4571},[446,756],[421,4573,3162],{"className":4574},[446],[421,4576,454],{"className":4577},[453],[421,4579,3023],{"className":4580},[446,447],[421,4582,463],{"className":4583},[462],[421,4585],{"className":4586,"style":468},[467],[421,4588,473],{"className":4589},[472],[421,4591],{"className":4592,"style":468},[467],[421,4594,4596,4599,4606,4609,4649,4652,4655,4658,4661,4664,4667,4707,4710],{"className":4595},[437],[421,4597],{"className":4598,"style":442},[441],[421,4600,4602],{"className":4601},[446,756],[421,4603,4605],{"className":4604},[446],"max profit obtainable from intervals ",[421,4607,3331],{"className":4608},[453],[421,4610,4612,4615],{"className":4611},[446],[421,4613,3339],{"className":4614,"style":3338},[446,447],[421,4616,4618],{"className":4617},[1252],[421,4619,4621,4641],{"className":4620},[499,500],[421,4622,4624,4638],{"className":4623},[504],[421,4625,4627],{"className":4626,"style":1262},[508],[421,4628,4629,4632],{"style":3354},[421,4630],{"className":4631,"style":1269},[516],[421,4633,4635],{"className":4634},[1273,1274,1275,1276],[421,4636,403],{"className":4637},[446,1276],[421,4639,588],{"className":4640},[587],[421,4642,4644],{"className":4643},[504],[421,4645,4647],{"className":4646,"style":1290},[508],[421,4648],{},[421,4650,780],{"className":4651},[779],[421,4653],{"className":4654,"style":1715},[467],[421,4656,1737],{"className":4657},[487],[421,4659],{"className":4660,"style":1715},[467],[421,4662,780],{"className":4663},[779],[421,4665],{"className":4666,"style":1715},[467],[421,4668,4670,4673],{"className":4669},[446],[421,4671,3339],{"className":4672,"style":3338},[446,447],[421,4674,4676],{"className":4675},[1252],[421,4677,4679,4699],{"className":4678},[499,500],[421,4680,4682,4696],{"className":4681},[504],[421,4683,4685],{"className":4684,"style":3468},[508],[421,4686,4687,4690],{"style":3354},[421,4688],{"className":4689,"style":1269},[516],[421,4691,4693],{"className":4692},[1273,1274,1275,1276],[421,4694,3023],{"className":4695},[446,447,1276],[421,4697,588],{"className":4698},[587],[421,4700,4702],{"className":4701},[504],[421,4703,4705],{"className":4704,"style":1290},[508],[421,4706],{},[421,4708,3436],{"className":4709},[462],[421,4711,780],{"className":4712},[779],[381,4714,4715,4716,4746,4747,4762],{},"and we want ",[421,4717,4719],{"className":4718},[428],[421,4720,4722],{"className":4721,"ariaHidden":433},[432],[421,4723,4725,4728,4737,4740,4743],{"className":4724},[437],[421,4726],{"className":4727,"style":442},[441],[421,4729,4731],{"className":4730},[1582,1583],[421,4732,4734],{"className":4733},[446,756],[421,4735,3162],{"className":4736},[446],[421,4738,454],{"className":4739},[453],[421,4741,458],{"className":4742},[446,447],[421,4744,463],{"className":4745},[462],". For each ",[421,4748,4750],{"className":4749},[428],[421,4751,4753],{"className":4752,"ariaHidden":433},[432],[421,4754,4756,4759],{"className":4755},[437],[421,4757],{"className":4758,"style":4546},[441],[421,4760,3023],{"className":4761},[446,447]," we also precompute",[421,4764,4766],{"className":4765},[424],[421,4767,4769],{"className":4768},[428],[421,4770,4772,4801],{"className":4771,"ariaHidden":433},[432],[421,4773,4775,4778,4783,4786,4789,4792,4795,4798],{"className":4774},[437],[421,4776],{"className":4777,"style":442},[441],[421,4779,4782],{"className":4780,"style":4781},[446,447],"margin-right:0.0359em;","q",[421,4784,454],{"className":4785},[453],[421,4787,3023],{"className":4788},[446,447],[421,4790,463],{"className":4791},[462],[421,4793],{"className":4794,"style":468},[467],[421,4796,473],{"className":4797},[472],[421,4799],{"className":4800,"style":468},[467],[421,4802,4804,4808,4817,4820,4977,4980],{"className":4803},[437],[421,4805],{"className":4806,"style":4807},[441],"height:1.0361em;vertical-align:-0.2861em;",[421,4809,4812],{"className":4810},[4811],"mop",[421,4813,4816],{"className":4814},[446,4815],"mathrm","max",[421,4818],{"className":4819,"style":1715},[467],[421,4821,4823,4826,4829,4834,4837,4841,4844,4885,4888,4892,4895,4935,4938,4941,4944,4948,4955,4958,4961,4965,4968,4971,4974],{"className":4822},[487],[421,4824,3683],{"className":4825,"style":3682},[453,3681],[421,4827],{"className":4828,"style":1715},[467],[421,4830,4833],{"className":4831,"style":4832},[446,447],"margin-right:0.0572em;","j",[421,4835],{"className":4836,"style":468},[467],[421,4838,4840],{"className":4839},[472],":",[421,4842],{"className":4843,"style":468},[467],[421,4845,4847,4850],{"className":4846},[446],[421,4848,3339],{"className":4849,"style":3338},[446,447],[421,4851,4853],{"className":4852},[1252],[421,4854,4856,4876],{"className":4855},[499,500],[421,4857,4859,4873],{"className":4858},[504],[421,4860,4862],{"className":4861,"style":3468},[508],[421,4863,4864,4867],{"style":3354},[421,4865],{"className":4866,"style":1269},[516],[421,4868,4870],{"className":4869},[1273,1274,1275,1276],[421,4871,4833],{"className":4872,"style":4832},[446,447,1276],[421,4874,588],{"className":4875},[587],[421,4877,4879],{"className":4878},[504],[421,4880,4883],{"className":4881,"style":4882},[508],"height:0.2861em;",[421,4884],{},[421,4886],{"className":4887,"style":666},[467],[421,4889,4891],{"className":4890},[670],"∩",[421,4893],{"className":4894,"style":666},[467],[421,4896,4898,4901],{"className":4897},[446],[421,4899,3339],{"className":4900,"style":3338},[446,447],[421,4902,4904],{"className":4903},[1252],[421,4905,4907,4927],{"className":4906},[499,500],[421,4908,4910,4924],{"className":4909},[504],[421,4911,4913],{"className":4912,"style":3468},[508],[421,4914,4915,4918],{"style":3354},[421,4916],{"className":4917,"style":1269},[516],[421,4919,4921],{"className":4920},[1273,1274,1275,1276],[421,4922,3023],{"className":4923},[446,447,1276],[421,4925,588],{"className":4926},[587],[421,4928,4930],{"className":4929},[504],[421,4931,4933],{"className":4932,"style":1290},[508],[421,4934],{},[421,4936],{"className":4937,"style":468},[467],[421,4939,473],{"className":4940},[472],[421,4942],{"className":4943,"style":468},[467],[421,4945,4947],{"className":4946},[446],"∅",[421,4949,4951],{"className":4950},[446,756],[421,4952,4954],{"className":4953},[446]," and ",[421,4956,4833],{"className":4957,"style":4832},[446,447],[421,4959],{"className":4960,"style":468},[467],[421,4962,4964],{"className":4963},[472],"\u003C",[421,4966],{"className":4967,"style":468},[467],[421,4969,3023],{"className":4970},[446,447],[421,4972],{"className":4973,"style":1715},[467],[421,4975,3878],{"className":4976,"style":3682},[462,3681],[421,4978],{"className":4979,"style":1715},[467],[421,4981,780],{"className":4982},[779],[381,4984,4985,4986,1680,4989,5041,5042,5094,5095,5137,5138,5247,5248,5272],{},"the index of the rightmost interval ",[389,4987,4988],{},"to the left of",[421,4990,4992],{"className":4991},[428],[421,4993,4995],{"className":4994,"ariaHidden":433},[432],[421,4996,4998,5001],{"className":4997},[437],[421,4999],{"className":5000,"style":1242},[441],[421,5002,5004,5007],{"className":5003},[446],[421,5005,3339],{"className":5006,"style":3338},[446,447],[421,5008,5010],{"className":5009},[1252],[421,5011,5013,5033],{"className":5012},[499,500],[421,5014,5016,5030],{"className":5015},[504],[421,5017,5019],{"className":5018,"style":3468},[508],[421,5020,5021,5024],{"style":3354},[421,5022],{"className":5023,"style":1269},[516],[421,5025,5027],{"className":5026},[1273,1274,1275,1276],[421,5028,3023],{"className":5029},[446,447,1276],[421,5031,588],{"className":5032},[587],[421,5034,5036],{"className":5035},[504],[421,5037,5039],{"className":5038,"style":1290},[508],[421,5040],{}," that does not overlap\n",[421,5043,5045],{"className":5044},[428],[421,5046,5048],{"className":5047,"ariaHidden":433},[432],[421,5049,5051,5054],{"className":5050},[437],[421,5052],{"className":5053,"style":1242},[441],[421,5055,5057,5060],{"className":5056},[446],[421,5058,3339],{"className":5059,"style":3338},[446,447],[421,5061,5063],{"className":5062},[1252],[421,5064,5066,5086],{"className":5065},[499,500],[421,5067,5069,5083],{"className":5068},[504],[421,5070,5072],{"className":5071,"style":3468},[508],[421,5073,5074,5077],{"style":3354},[421,5075],{"className":5076,"style":1269},[516],[421,5078,5080],{"className":5079},[1273,1274,1275,1276],[421,5081,3023],{"className":5082},[446,447,1276],[421,5084,588],{"className":5085},[587],[421,5087,5089],{"className":5088},[504],[421,5090,5092],{"className":5091,"style":1290},[508],[421,5093],{}," (and ",[421,5096,5098],{"className":5097},[428],[421,5099,5101,5128],{"className":5100,"ariaHidden":433},[432],[421,5102,5104,5107,5110,5113,5116,5119,5122,5125],{"className":5103},[437],[421,5105],{"className":5106,"style":442},[441],[421,5108,4782],{"className":5109,"style":4781},[446,447],[421,5111,454],{"className":5112},[453],[421,5114,3023],{"className":5115},[446,447],[421,5117,463],{"className":5118},[462],[421,5120],{"className":5121,"style":468},[467],[421,5123,473],{"className":5124},[472],[421,5126],{"className":5127,"style":468},[467],[421,5129,5131,5134],{"className":5130},[437],[421,5132],{"className":5133,"style":1560},[441],[421,5135,632],{"className":5136},[446]," if none exists). Because finish times are sorted, ",[4782,5139,5140,5193,5194,5246],{},[421,5141,5143],{"className":5142},[428],[421,5144,5146],{"className":5145,"ariaHidden":433},[432],[421,5147,5149,5153],{"className":5148},[437],[421,5150],{"className":5151,"style":5152},[441],"height:0.9694em;vertical-align:-0.2861em;",[421,5154,5156,5159],{"className":5155},[446],[421,5157,3339],{"className":5158,"style":3338},[446,447],[421,5160,5162],{"className":5161},[1252],[421,5163,5165,5185],{"className":5164},[499,500],[421,5166,5168,5182],{"className":5167},[504],[421,5169,5171],{"className":5170,"style":3468},[508],[421,5172,5173,5176],{"style":3354},[421,5174],{"className":5175,"style":1269},[516],[421,5177,5179],{"className":5178},[1273,1274,1275,1276],[421,5180,4833],{"className":5181,"style":4832},[446,447,1276],[421,5183,588],{"className":5184},[587],[421,5186,5188],{"className":5187},[504],[421,5189,5191],{"className":5190,"style":4882},[508],[421,5192],{}," ends before ",[421,5195,5197],{"className":5196},[428],[421,5198,5200],{"className":5199,"ariaHidden":433},[432],[421,5201,5203,5206],{"className":5202},[437],[421,5204],{"className":5205,"style":1242},[441],[421,5207,5209,5212],{"className":5208},[446],[421,5210,3339],{"className":5211,"style":3338},[446,447],[421,5213,5215],{"className":5214},[1252],[421,5216,5218,5238],{"className":5217},[499,500],[421,5219,5221,5235],{"className":5220},[504],[421,5222,5224],{"className":5223,"style":3468},[508],[421,5225,5226,5229],{"style":3354},[421,5227],{"className":5228,"style":1269},[516],[421,5230,5232],{"className":5231},[1273,1274,1275,1276],[421,5233,3023],{"className":5234},[446,447,1276],[421,5236,588],{"className":5237},[587],[421,5239,5241],{"className":5240},[504],[421,5242,5244],{"className":5243,"style":1290},[508],[421,5245],{}," starts"," is exactly the test, so ",[421,5249,5251],{"className":5250},[428],[421,5252,5254],{"className":5253,"ariaHidden":433},[432],[421,5255,5257,5260,5263,5266,5269],{"className":5256},[437],[421,5258],{"className":5259,"style":442},[441],[421,5261,4782],{"className":5262,"style":4781},[446,447],[421,5264,454],{"className":5265},[453],[421,5267,3023],{"className":5268},[446,447],[421,5270,463],{"className":5271},[462]," is well defined.",[381,5274,5275,5276,5300,5301,5353],{},"Drawn on a timeline, the intervals stack up by finish time, and ",[421,5277,5279],{"className":5278},[428],[421,5280,5282],{"className":5281,"ariaHidden":433},[432],[421,5283,5285,5288,5291,5294,5297],{"className":5284},[437],[421,5286],{"className":5287,"style":442},[441],[421,5289,4782],{"className":5290,"style":4781},[446,447],[421,5292,454],{"className":5293},[453],[421,5295,3023],{"className":5296},[446,447],[421,5298,463],{"className":5299},[462]," is just the\nlast bar that clears ",[421,5302,5304],{"className":5303},[428],[421,5305,5307],{"className":5306,"ariaHidden":433},[432],[421,5308,5310,5313],{"className":5309},[437],[421,5311],{"className":5312,"style":1242},[441],[421,5314,5316,5319],{"className":5315},[446],[421,5317,3339],{"className":5318,"style":3338},[446,447],[421,5320,5322],{"className":5321},[1252],[421,5323,5325,5345],{"className":5324},[499,500],[421,5326,5328,5342],{"className":5327},[504],[421,5329,5331],{"className":5330,"style":3468},[508],[421,5332,5333,5336],{"style":3354},[421,5334],{"className":5335,"style":1269},[516],[421,5337,5339],{"className":5338},[1273,1274,1275,1276],[421,5340,3023],{"className":5341},[446,447,1276],[421,5343,588],{"className":5344},[587],[421,5346,5348],{"className":5347},[504],[421,5349,5351],{"className":5350,"style":1290},[508],[421,5352],{},"'s left edge:",[927,5355,5357,5610],{"className":5356},[930,931],[536,5358,5362],{"xmlns":538,"width":5359,"height":5360,"viewBox":5361},"314.440","207.765","-75 -75 235.830 155.824",[938,5363,5364,5385,5404,5423,5442,5461,5482,5497,5501,5530,5539],{"stroke":940,"style":941},[938,5365,5367,5370],{"fill":5366},"var(--tk-soft-accent)",[545,5368],{"d":5369},"M-48.132-41.561h39.834v-12.804h-39.834Z",[938,5371,5372,5379],{"fill":940,"stroke":944},[938,5373,5375],{"transform":5374},"translate(21.502 2.575)",[545,5376],{"d":5377,"fill":940,"stroke":940,"className":5378,"style":1965},"M-50.904-47.963L-53.400-47.963Q-53.497-47.963-53.497-48.082Q-53.497-48.143-53.464-48.211Q-53.431-48.279-53.374-48.279Q-52.842-48.279-52.609-48.332Q-52.477-48.376-52.398-48.609L-51.176-53.526Q-51.159-53.614-51.159-53.650Q-51.159-53.729-51.220-53.751Q-51.445-53.795-51.932-53.795Q-52.038-53.795-52.038-53.913Q-52.038-54.111-51.880-54.111L-49.384-54.111Q-49.340-54.111-49.309-54.076Q-49.278-54.041-49.278-54.001Q-49.278-53.935-49.311-53.865Q-49.344-53.795-49.401-53.795Q-49.933-53.795-50.179-53.742Q-50.298-53.698-50.377-53.461L-51.598-48.547Q-51.616-48.504-51.616-48.420Q-51.616-48.345-51.554-48.323Q-51.339-48.279-50.843-48.279Q-50.794-48.279-50.766-48.246Q-50.737-48.213-50.737-48.170Q-50.737-47.963-50.904-47.963",[955],[938,5380,5381],{"transform":5374},[545,5382],{"d":5383,"fill":940,"stroke":940,"className":5384,"style":1972},"M-46.738-46.963L-49.029-46.963L-49.029-47.221Q-48.153-47.221-48.153-47.394L-48.153-50.473Q-48.346-50.385-48.578-50.348Q-48.809-50.312-49.064-50.312L-49.064-50.569Q-48.686-50.569-48.365-50.654Q-48.045-50.739-47.816-50.953L-47.696-50.953Q-47.664-50.953-47.639-50.930Q-47.614-50.906-47.614-50.868L-47.614-47.394Q-47.614-47.221-46.738-47.221",[955],[938,5386,5387,5390],{"fill":5366},[545,5388],{"d":5389},"M-8.298-21.644h45.524v-12.804H-8.298Z",[938,5391,5392,5398],{"fill":940,"stroke":944},[938,5393,5395],{"transform":5394},"translate(64.181 22.492)",[545,5396],{"d":5377,"fill":940,"stroke":940,"className":5397,"style":1965},[955],[938,5399,5400],{"transform":5394},[545,5401],{"d":5402,"fill":940,"stroke":940,"className":5403,"style":1972},"M-46.738-46.963L-49.348-46.963L-49.348-47.148Q-49.342-47.171-49.322-47.197L-48.171-48.252Q-47.831-48.563-47.651-48.749Q-47.470-48.935-47.325-49.195Q-47.180-49.456-47.180-49.752Q-47.180-50.025-47.306-50.240Q-47.432-50.455-47.652-50.575Q-47.872-50.695-48.147-50.695Q-48.323-50.695-48.493-50.638Q-48.663-50.581-48.795-50.474Q-48.926-50.367-49.006-50.209Q-48.918-50.209-48.840-50.165Q-48.762-50.121-48.718-50.045Q-48.675-49.969-48.675-49.872Q-48.675-49.732-48.771-49.635Q-48.868-49.538-49.011-49.538Q-49.149-49.538-49.249-49.638Q-49.348-49.737-49.348-49.872Q-49.348-50.197-49.158-50.445Q-48.967-50.692-48.664-50.823Q-48.361-50.953-48.045-50.953Q-47.664-50.953-47.321-50.818Q-46.978-50.684-46.764-50.411Q-46.550-50.139-46.550-49.752Q-46.550-49.477-46.675-49.250Q-46.800-49.023-46.980-48.851Q-47.160-48.680-47.485-48.440Q-47.810-48.199-47.895-48.132L-48.651-47.528L-48.118-47.528Q-47.629-47.528-47.298-47.536Q-46.967-47.543-46.952-47.558Q-46.893-47.628-46.861-47.763Q-46.829-47.898-46.797-48.109L-46.550-48.109",[955],[938,5405,5406,5409],{"fill":5366},[545,5407],{"d":5408},"M-35.328-1.728H1.66V-14.53h-36.988Z",[938,5410,5411,5417],{"fill":940,"stroke":944},[938,5412,5414],{"transform":5413},"translate(32.884 42.409)",[545,5415],{"d":5377,"fill":940,"stroke":940,"className":5416,"style":1965},[955],[938,5418,5419],{"transform":5413},[545,5420],{"d":5421,"fill":940,"stroke":940,"className":5422,"style":1972},"M-49.006-47.414Q-48.710-47.077-47.980-47.077Q-47.722-47.077-47.542-47.205Q-47.362-47.332-47.274-47.540Q-47.186-47.748-47.186-48.006Q-47.186-48.401-47.393-48.672Q-47.599-48.943-47.986-48.943L-48.452-48.943Q-48.516-48.958-48.531-49.020L-48.531-49.087Q-48.516-49.143-48.452-49.160L-48.050-49.184Q-47.840-49.184-47.671-49.326Q-47.503-49.468-47.410-49.682Q-47.318-49.896-47.318-50.112Q-47.318-50.400-47.503-50.565Q-47.687-50.731-47.980-50.731Q-48.241-50.731-48.465-50.663Q-48.689-50.596-48.836-50.438Q-48.707-50.420-48.628-50.331Q-48.549-50.241-48.549-50.112Q-48.549-49.975-48.644-49.880Q-48.739-49.784-48.880-49.784Q-49.014-49.784-49.111-49.881Q-49.208-49.978-49.208-50.112Q-49.208-50.400-49.017-50.591Q-48.827-50.783-48.546-50.868Q-48.264-50.953-47.980-50.953Q-47.705-50.953-47.404-50.862Q-47.104-50.772-46.896-50.583Q-46.688-50.394-46.688-50.112Q-46.688-49.743-46.934-49.471Q-47.180-49.198-47.552-49.069Q-47.133-48.976-46.816-48.693Q-46.498-48.410-46.498-48.012Q-46.498-47.649-46.717-47.383Q-46.937-47.118-47.283-46.978Q-47.629-46.837-47.980-46.837Q-48.203-46.837-48.450-46.885Q-48.698-46.934-48.918-47.044Q-49.137-47.153-49.269-47.332Q-49.401-47.511-49.401-47.766Q-49.401-47.915-49.299-48.018Q-49.196-48.120-49.047-48.120Q-48.897-48.120-48.795-48.018Q-48.692-47.915-48.692-47.766Q-48.692-47.634-48.781-47.533Q-48.871-47.432-49.006-47.414",[955],[938,5424,5425,5428],{"fill":5366},[545,5426],{"d":5427},"M21.577 18.19h42.68V5.386h-42.68Z",[938,5429,5430,5436],{"fill":940,"stroke":944},[938,5431,5433],{"transform":5432},"translate(92.634 62.326)",[545,5434],{"d":5377,"fill":940,"stroke":940,"className":5435,"style":1965},[955],[938,5437,5438],{"transform":5432},[545,5439],{"d":5440,"fill":940,"stroke":940,"className":5441,"style":1972},"M-47.649-47.942L-49.504-47.942L-49.504-48.199L-47.409-50.906Q-47.371-50.953-47.312-50.953L-47.180-50.953Q-47.139-50.953-47.112-50.925Q-47.084-50.898-47.084-50.857L-47.084-48.199L-46.395-48.199L-46.395-47.942L-47.084-47.942L-47.084-47.394Q-47.084-47.221-46.407-47.221L-46.407-46.963L-48.326-46.963L-48.326-47.221Q-47.649-47.221-47.649-47.394L-47.649-47.942M-47.608-50.282L-49.214-48.199L-47.608-48.199",[955],[938,5443,5444,5447],{"fill":5366},[545,5445],{"d":5446},"M59.988 38.106h39.834V25.303H59.988Z",[938,5448,5449,5455],{"fill":940,"stroke":944},[938,5450,5452],{"transform":5451},"translate(129.623 82.243)",[545,5453],{"d":5377,"fill":940,"stroke":940,"className":5454,"style":1965},[955],[938,5456,5457],{"transform":5451},[545,5458],{"d":5459,"fill":940,"stroke":940,"className":5460,"style":1972},"M-49.023-47.605Q-48.947-47.438-48.799-47.319Q-48.651-47.200-48.462-47.139Q-48.273-47.077-48.086-47.077Q-47.769-47.077-47.566-47.219Q-47.362-47.361-47.268-47.608Q-47.175-47.854-47.175-48.164Q-47.175-48.618-47.322-48.939Q-47.470-49.260-47.872-49.260Q-48.121-49.260-48.289-49.198Q-48.458-49.137-48.563-49.052Q-48.669-48.967-48.745-48.883Q-48.821-48.800-48.856-48.794L-48.921-48.794Q-48.950-48.794-48.978-48.825Q-49.006-48.856-49.006-48.882L-49.006-50.880Q-48.997-50.953-48.921-50.953Q-48.915-50.953-48.891-50.947Q-48.402-50.760-47.919-50.760Q-47.429-50.760-46.940-50.947Q-46.917-50.953-46.911-50.953Q-46.846-50.953-46.826-50.880L-46.826-50.816Q-46.829-50.792-46.846-50.766Q-47.107-50.493-47.446-50.342Q-47.784-50.192-48.147-50.192Q-48.469-50.192-48.748-50.268L-48.748-49.184Q-48.575-49.333-48.349-49.405Q-48.124-49.477-47.872-49.477Q-47.511-49.477-47.208-49.299Q-46.905-49.122-46.728-48.822Q-46.550-48.522-46.550-48.164Q-46.550-47.780-46.773-47.474Q-46.996-47.168-47.350-47.003Q-47.705-46.837-48.086-46.837Q-48.396-46.837-48.691-46.972Q-48.985-47.107-49.167-47.356Q-49.348-47.605-49.348-47.930Q-49.348-48.065-49.258-48.155Q-49.167-48.246-49.029-48.246Q-48.894-48.246-48.799-48.155Q-48.704-48.065-48.704-47.930Q-48.704-47.792-48.795-47.698Q-48.885-47.605-49.023-47.605",[955],[938,5462,5465,5468],{"fill":5366,"stroke":5463,"style":5464},"var(--tk-accent)","stroke-width:1.2",[545,5466],{"d":5467},"M50.03 58.023h51.215V45.22H50.03Z",[938,5469,5470,5476],{"fill":940,"stroke":944},[938,5471,5473],{"transform":5472},"translate(125.355 102.16)",[545,5474],{"d":5377,"fill":940,"stroke":940,"className":5475,"style":1965},[955],[938,5477,5478],{"transform":5472},[545,5479],{"d":5480,"fill":940,"stroke":940,"className":5481,"style":1972},"M-47.948-46.837Q-48.358-46.837-48.642-47.016Q-48.926-47.194-49.095-47.502Q-49.263-47.810-49.332-48.171Q-49.401-48.533-49.401-48.902Q-49.401-49.418-49.168-49.894Q-48.935-50.370-48.515-50.662Q-48.094-50.953-47.558-50.953Q-47.186-50.953-46.928-50.786Q-46.671-50.619-46.671-50.262Q-46.671-50.133-46.756-50.048Q-46.841-49.963-46.972-49.963Q-47.101-49.963-47.189-50.048Q-47.277-50.133-47.277-50.262Q-47.277-50.373-47.207-50.457Q-47.136-50.540-47.031-50.564Q-47.192-50.731-47.558-50.731Q-47.860-50.731-48.113-50.574Q-48.367-50.417-48.531-50.156Q-48.672-49.913-48.724-49.616Q-48.777-49.318-48.777-48.984Q-48.437-49.532-47.872-49.532Q-47.494-49.532-47.180-49.357Q-46.867-49.181-46.682-48.876Q-46.498-48.571-46.498-48.193Q-46.498-47.801-46.697-47.490Q-46.896-47.180-47.230-47.008Q-47.564-46.837-47.948-46.837M-47.948-47.077Q-47.614-47.077-47.429-47.224Q-47.245-47.370-47.183-47.608Q-47.122-47.845-47.122-48.182L-47.122-48.199Q-47.122-48.715-47.279-49.015Q-47.435-49.316-47.907-49.316Q-48.162-49.316-48.357-49.171Q-48.551-49.026-48.655-48.797Q-48.759-48.568-48.759-48.319Q-48.759-48.240-48.754-48.199Q-48.754-48.179-48.757-48.179Q-48.759-48.179-48.759-48.158Q-48.759-47.728-48.559-47.402Q-48.358-47.077-47.948-47.077",[955],[938,5483,5484,5487,5490],{"style":2737},[545,5485],{"fill":944,"d":5486},"M-65.203 71.538H129.84",[545,5488],{"d":5489},"m132.827 71.538-4.17-1.576 1.383 1.576-1.382 1.577Z",[938,5491,5493],{"transform":5492},"translate(191.521 122.184)",[545,5494],{"d":5495,"fill":940,"stroke":940,"className":5496,"style":2626},"M-52.959-48.924L-52.959-51.115L-53.662-51.115L-53.662-51.369Q-53.306-51.369-53.064-51.602Q-52.822-51.834-52.711-52.182Q-52.599-52.529-52.599-52.885L-52.318-52.885L-52.318-51.412L-51.142-51.412L-51.142-51.115L-52.318-51.115L-52.318-48.940Q-52.318-48.619-52.199-48.391Q-52.080-48.162-51.799-48.162Q-51.619-48.162-51.502-48.285Q-51.385-48.408-51.332-48.588Q-51.279-48.768-51.279-48.940L-51.279-49.412L-50.998-49.412L-50.998-48.924Q-50.998-48.670-51.103-48.430Q-51.209-48.190-51.406-48.037Q-51.603-47.885-51.861-47.885Q-52.177-47.885-52.429-48.008Q-52.681-48.131-52.820-48.365Q-52.959-48.600-52.959-48.924M-48.420-47.963L-50.197-47.963L-50.197-48.260Q-49.924-48.260-49.756-48.307Q-49.588-48.354-49.588-48.522L-49.588-50.658Q-49.588-50.873-49.644-50.969Q-49.701-51.065-49.814-51.086Q-49.927-51.108-50.174-51.108L-50.174-51.404L-48.974-51.490L-48.974-48.522Q-48.974-48.354-48.828-48.307Q-48.681-48.260-48.420-48.260L-48.420-47.963M-49.861-52.885Q-49.861-53.076-49.726-53.207Q-49.592-53.338-49.396-53.338Q-49.275-53.338-49.172-53.276Q-49.068-53.213-49.006-53.109Q-48.943-53.006-48.943-52.885Q-48.943-52.690-49.074-52.555Q-49.205-52.420-49.396-52.420Q-49.595-52.420-49.728-52.553Q-49.861-52.686-49.861-52.885M-45.990-47.963L-47.845-47.963L-47.845-48.260Q-47.572-48.260-47.404-48.307Q-47.236-48.354-47.236-48.522L-47.236-50.658Q-47.236-50.873-47.299-50.969Q-47.361-51.065-47.480-51.086Q-47.599-51.108-47.845-51.108L-47.845-51.404L-46.654-51.490L-46.654-50.756Q-46.541-50.971-46.347-51.139Q-46.154-51.307-45.916-51.399Q-45.677-51.490-45.424-51.490Q-44.463-51.490-44.287-50.779Q-44.103-51.108-43.775-51.299Q-43.447-51.490-43.068-51.490Q-41.892-51.490-41.892-50.412L-41.892-48.522Q-41.892-48.354-41.724-48.307Q-41.556-48.260-41.287-48.260L-41.287-47.963L-43.142-47.963L-43.142-48.260Q-42.869-48.260-42.701-48.305Q-42.533-48.350-42.533-48.522L-42.533-50.397Q-42.533-50.783-42.658-51.010Q-42.783-51.236-43.135-51.236Q-43.439-51.236-43.695-51.074Q-43.951-50.912-44.099-50.643Q-44.248-50.373-44.248-50.076L-44.248-48.522Q-44.248-48.354-44.078-48.307Q-43.908-48.260-43.638-48.260L-43.638-47.963L-45.494-47.963L-45.494-48.260Q-45.220-48.260-45.052-48.307Q-44.885-48.354-44.885-48.522L-44.885-50.397Q-44.885-50.783-45.010-51.010Q-45.135-51.236-45.486-51.236Q-45.791-51.236-46.047-51.074Q-46.302-50.912-46.451-50.643Q-46.599-50.373-46.599-50.076L-46.599-48.522Q-46.599-48.354-46.429-48.307Q-46.260-48.260-45.990-48.260L-45.990-47.963M-40.842-49.717Q-40.842-50.197-40.609-50.613Q-40.377-51.029-39.967-51.279Q-39.556-51.529-39.080-51.529Q-38.349-51.529-37.951-51.088Q-37.552-50.647-37.552-49.916Q-37.552-49.811-37.646-49.787L-40.095-49.787L-40.095-49.717Q-40.095-49.307-39.974-48.951Q-39.853-48.596-39.582-48.379Q-39.310-48.162-38.881-48.162Q-38.517-48.162-38.220-48.391Q-37.924-48.619-37.822-48.971Q-37.814-49.018-37.728-49.033L-37.646-49.033Q-37.552-49.006-37.552-48.924Q-37.552-48.916-37.560-48.885Q-37.623-48.658-37.761-48.475Q-37.900-48.291-38.092-48.158Q-38.283-48.026-38.502-47.955Q-38.720-47.885-38.959-47.885Q-39.330-47.885-39.668-48.022Q-40.006-48.158-40.273-48.410Q-40.541-48.662-40.691-49.002Q-40.842-49.342-40.842-49.717M-40.088-50.026L-38.127-50.026Q-38.127-50.330-38.228-50.621Q-38.330-50.912-38.547-51.094Q-38.763-51.276-39.080-51.276Q-39.381-51.276-39.611-51.088Q-39.842-50.901-39.965-50.609Q-40.088-50.318-40.088-50.026",[955],[545,5498],{"fill":944,"stroke":5463,"d":5499,"style":5500},"M52.875 61.58V-57.922","stroke-dasharray:3.0,3.0",[938,5502,5503],{"fill":5463,"stroke":5463},[938,5504,5505,5512,5518,5524],{"fill":5463,"stroke":944},[938,5506,5508],{"transform":5507},"translate(87.751 -15.418)",[545,5509],{"d":5510,"fill":5463,"stroke":5463,"className":5511,"style":2626},"M-53.541-47.971L-53.541-49.193Q-53.541-49.221-53.510-49.252Q-53.478-49.283-53.455-49.283L-53.349-49.283Q-53.279-49.283-53.263-49.221Q-53.201-48.901-53.062-48.660Q-52.924-48.420-52.691-48.279Q-52.459-48.139-52.150-48.139Q-51.912-48.139-51.703-48.199Q-51.494-48.260-51.357-48.408Q-51.220-48.557-51.220-48.803Q-51.220-49.057-51.431-49.223Q-51.642-49.389-51.912-49.443L-52.533-49.557Q-52.939-49.635-53.240-49.891Q-53.541-50.147-53.541-50.522Q-53.541-50.889-53.340-51.111Q-53.138-51.334-52.814-51.432Q-52.490-51.529-52.150-51.529Q-51.685-51.529-51.388-51.322L-51.166-51.506Q-51.142-51.529-51.111-51.529L-51.060-51.529Q-51.029-51.529-51.002-51.502Q-50.974-51.475-50.974-51.443L-50.974-50.459Q-50.974-50.428-51-50.399Q-51.025-50.369-51.060-50.369L-51.166-50.369Q-51.201-50.369-51.228-50.397Q-51.256-50.424-51.256-50.459Q-51.256-50.858-51.508-51.078Q-51.760-51.299-52.158-51.299Q-52.513-51.299-52.797-51.176Q-53.080-51.053-53.080-50.748Q-53.080-50.529-52.879-50.397Q-52.677-50.264-52.431-50.221L-51.806-50.108Q-51.377-50.018-51.068-49.721Q-50.760-49.424-50.760-49.010Q-50.760-48.440-51.158-48.162Q-51.556-47.885-52.150-47.885Q-52.701-47.885-53.052-48.221L-53.349-47.908Q-53.373-47.885-53.408-47.885L-53.455-47.885Q-53.478-47.885-53.510-47.916Q-53.541-47.947-53.541-47.971M-49.607-48.924L-49.607-51.115L-50.310-51.115L-50.310-51.369Q-49.955-51.369-49.713-51.602Q-49.470-51.834-49.359-52.182Q-49.248-52.529-49.248-52.885L-48.967-52.885L-48.967-51.412L-47.791-51.412L-47.791-51.115L-48.967-51.115L-48.967-48.940Q-48.967-48.619-48.847-48.391Q-48.728-48.162-48.447-48.162Q-48.267-48.162-48.150-48.285Q-48.033-48.408-47.980-48.588Q-47.927-48.768-47.927-48.940L-47.927-49.412L-47.646-49.412L-47.646-48.924Q-47.646-48.670-47.752-48.430Q-47.857-48.190-48.054-48.037Q-48.252-47.885-48.510-47.885Q-48.826-47.885-49.078-48.008Q-49.330-48.131-49.468-48.365Q-49.607-48.600-49.607-48.924M-46.830-48.795Q-46.830-49.279-46.427-49.574Q-46.025-49.869-45.474-49.988Q-44.924-50.108-44.431-50.108L-44.431-50.397Q-44.431-50.623-44.547-50.830Q-44.662-51.037-44.859-51.156Q-45.056-51.276-45.287-51.276Q-45.713-51.276-45.998-51.170Q-45.927-51.143-45.881-51.088Q-45.834-51.033-45.808-50.963Q-45.783-50.893-45.783-50.818Q-45.783-50.713-45.834-50.621Q-45.885-50.529-45.976-50.479Q-46.068-50.428-46.174-50.428Q-46.279-50.428-46.371-50.479Q-46.463-50.529-46.513-50.621Q-46.564-50.713-46.564-50.818Q-46.564-51.236-46.176-51.383Q-45.787-51.529-45.287-51.529Q-44.955-51.529-44.601-51.399Q-44.248-51.268-44.019-51.014Q-43.791-50.760-43.791-50.412L-43.791-48.611Q-43.791-48.479-43.718-48.369Q-43.646-48.260-43.517-48.260Q-43.392-48.260-43.324-48.365Q-43.256-48.471-43.256-48.611L-43.256-49.123L-42.974-49.123L-42.974-48.611Q-42.974-48.408-43.092-48.250Q-43.209-48.092-43.390-48.008Q-43.572-47.924-43.775-47.924Q-44.006-47.924-44.158-48.096Q-44.310-48.268-44.342-48.498Q-44.502-48.217-44.810-48.051Q-45.119-47.885-45.470-47.885Q-45.982-47.885-46.406-48.108Q-46.830-48.330-46.830-48.795M-46.142-48.795Q-46.142-48.510-45.916-48.324Q-45.689-48.139-45.396-48.139Q-45.150-48.139-44.926-48.256Q-44.701-48.373-44.566-48.576Q-44.431-48.779-44.431-49.033L-44.431-49.865Q-44.697-49.865-44.982-49.811Q-45.267-49.756-45.539-49.627Q-45.810-49.498-45.976-49.291Q-46.142-49.084-46.142-48.795M-40.674-47.963L-42.654-47.963L-42.654-48.260Q-42.385-48.260-42.217-48.305Q-42.049-48.350-42.049-48.522L-42.049-50.658Q-42.049-50.873-42.111-50.969Q-42.174-51.065-42.291-51.086Q-42.408-51.108-42.654-51.108L-42.654-51.404L-41.486-51.490L-41.486-50.705Q-41.408-50.916-41.256-51.102Q-41.103-51.287-40.904-51.389Q-40.705-51.490-40.478-51.490Q-40.232-51.490-40.041-51.346Q-39.849-51.201-39.849-50.971Q-39.849-50.815-39.955-50.705Q-40.060-50.596-40.217-50.596Q-40.373-50.596-40.482-50.705Q-40.592-50.815-40.592-50.971Q-40.592-51.131-40.486-51.236Q-40.810-51.236-41.025-51.008Q-41.240-50.779-41.336-50.440Q-41.431-50.100-41.431-49.795L-41.431-48.522Q-41.431-48.354-41.205-48.307Q-40.978-48.260-40.674-48.260L-40.674-47.963M-38.744-48.924L-38.744-51.115L-39.447-51.115L-39.447-51.369Q-39.092-51.369-38.849-51.602Q-38.607-51.834-38.496-52.182Q-38.385-52.529-38.385-52.885L-38.103-52.885L-38.103-51.412L-36.927-51.412L-36.927-51.115L-38.103-51.115L-38.103-48.940Q-38.103-48.619-37.984-48.391Q-37.865-48.162-37.584-48.162Q-37.404-48.162-37.287-48.285Q-37.170-48.408-37.117-48.588Q-37.064-48.768-37.064-48.940L-37.064-49.412L-36.783-49.412L-36.783-48.924Q-36.783-48.670-36.888-48.430Q-36.994-48.190-37.191-48.037Q-37.388-47.885-37.646-47.885Q-37.963-47.885-38.215-48.008Q-38.467-48.131-38.605-48.365Q-38.744-48.600-38.744-48.924",[955],[938,5513,5514],{"transform":5507},[545,5515],{"d":5516,"fill":5463,"stroke":5463,"className":5517,"style":2626},"M-33.224-49.658Q-33.224-50.162-32.968-50.594Q-32.712-51.026-32.276-51.277Q-31.841-51.529-31.341-51.529Q-30.954-51.529-30.612-51.385Q-30.271-51.240-30.009-50.979Q-29.747-50.717-29.605-50.381Q-29.462-50.045-29.462-49.658Q-29.462-49.166-29.726-48.756Q-29.989-48.346-30.419-48.115Q-30.849-47.885-31.341-47.885Q-31.833-47.885-32.267-48.117Q-32.700-48.350-32.962-48.758Q-33.224-49.166-33.224-49.658M-31.341-48.162Q-30.884-48.162-30.632-48.385Q-30.380-48.608-30.292-48.959Q-30.204-49.311-30.204-49.756Q-30.204-50.186-30.298-50.524Q-30.392-50.861-30.646-51.068Q-30.900-51.276-31.341-51.276Q-31.989-51.276-32.233-50.859Q-32.478-50.443-32.478-49.756Q-32.478-49.311-32.390-48.959Q-32.302-48.608-32.050-48.385Q-31.798-48.162-31.341-48.162M-26.911-47.963L-28.896-47.963L-28.896-48.260Q-28.622-48.260-28.454-48.307Q-28.286-48.354-28.286-48.522L-28.286-51.115L-28.927-51.115L-28.927-51.412L-28.286-51.412L-28.286-52.346Q-28.286-52.611-28.169-52.848Q-28.052-53.084-27.858-53.248Q-27.665-53.412-27.417-53.504Q-27.169-53.596-26.903-53.596Q-26.618-53.596-26.394-53.438Q-26.169-53.279-26.169-53.002Q-26.169-52.846-26.275-52.736Q-26.380-52.627-26.544-52.627Q-26.700-52.627-26.810-52.736Q-26.919-52.846-26.919-53.002Q-26.919-53.209-26.759-53.315Q-26.857-53.338-26.950-53.338Q-27.181-53.338-27.353-53.182Q-27.525-53.026-27.610-52.789Q-27.696-52.553-27.696-52.330L-27.696-51.412L-26.728-51.412L-26.728-51.115L-27.673-51.115L-27.673-48.522Q-27.673-48.354-27.446-48.307Q-27.220-48.260-26.911-48.260",[955],[938,5519,5520],{"transform":5507},[545,5521],{"d":5522,"fill":5463,"stroke":5463,"className":5523,"style":2626},"M-21.102-47.963L-23.341-47.963Q-23.384-47.963-23.411-48.004Q-23.438-48.045-23.438-48.092L-23.415-48.193Q-23.407-48.240-23.317-48.260Q-23.102-48.260-22.932-48.270Q-22.762-48.279-22.677-48.299Q-22.520-48.338-22.477-48.565L-21.399-52.885Q-21.376-52.943-21.376-53.010Q-21.376-53.076-21.446-53.100Q-21.598-53.131-22.048-53.131Q-22.149-53.158-22.149-53.260L-22.118-53.361Q-22.110-53.408-22.028-53.428L-19.790-53.428Q-19.755-53.428-19.723-53.387Q-19.692-53.346-19.692-53.307L-19.720-53.201Q-19.739-53.147-19.813-53.131Q-20.286-53.131-20.454-53.092Q-20.602-53.057-20.661-52.826L-21.743-48.506Q-21.759-48.428-21.759-48.377Q-21.759-48.311-21.692-48.291Q-21.536-48.260-21.087-48.260Q-20.989-48.233-20.989-48.139L-21.012-48.033Q-21.020-47.983-21.102-47.963",[955],[938,5525,5526],{"transform":5507},[545,5527],{"d":5528,"fill":5463,"stroke":5463,"className":5529,"style":1972},"M-18.265-46.726Q-18.675-46.726-18.959-46.905Q-19.243-47.083-19.412-47.391Q-19.580-47.699-19.649-48.060Q-19.718-48.422-19.718-48.791Q-19.718-49.307-19.485-49.783Q-19.252-50.259-18.832-50.551Q-18.411-50.842-17.875-50.842Q-17.503-50.842-17.245-50.675Q-16.988-50.508-16.988-50.151Q-16.988-50.022-17.073-49.937Q-17.158-49.852-17.289-49.852Q-17.418-49.852-17.506-49.937Q-17.594-50.022-17.594-50.151Q-17.594-50.262-17.524-50.346Q-17.453-50.429-17.348-50.453Q-17.509-50.620-17.875-50.620Q-18.177-50.620-18.430-50.463Q-18.684-50.306-18.848-50.045Q-18.989-49.802-19.041-49.505Q-19.094-49.207-19.094-48.873Q-18.754-49.421-18.189-49.421Q-17.811-49.421-17.497-49.246Q-17.184-49.070-16.999-48.765Q-16.815-48.460-16.815-48.082Q-16.815-47.690-17.014-47.379Q-17.213-47.069-17.547-46.897Q-17.881-46.726-18.265-46.726M-18.265-46.966Q-17.931-46.966-17.746-47.113Q-17.562-47.259-17.500-47.497Q-17.439-47.734-17.439-48.071L-17.439-48.088Q-17.439-48.604-17.596-48.904Q-17.752-49.205-18.224-49.205Q-18.479-49.205-18.674-49.060Q-18.868-48.914-18.972-48.686Q-19.076-48.457-19.076-48.208Q-19.076-48.129-19.071-48.088Q-19.071-48.068-19.074-48.068Q-19.076-48.068-19.076-48.047Q-19.076-47.617-18.876-47.291Q-18.675-46.966-18.265-46.966",[955],[938,5531,5532,5535],{"fill":2736,"stroke":2736,"style":5464},[545,5533],{"fill":944,"d":5534},"M1.66-8.13c18.495 34.144 29.876 45.525 42.971 56.438",[545,5536],{"d":5537,"style":5538},"M47.295 50.528 44.797 46.1l.065 2.4-2.372.37Z","stroke-width:1.19994",[938,5540,5541],{"fill":2736,"stroke":2736},[938,5542,5543,5550,5556,5562,5568,5574,5580,5586,5592,5598,5604],{"fill":2736,"stroke":944},[938,5544,5546],{"transform":5545},"translate(-2.208 88.322)",[545,5547],{"d":5548,"fill":2736,"stroke":2736,"className":5549,"style":2626},"M-49.893-65.529L-49.870-65.635Q-49.862-65.686-49.780-65.705Q-49.174-65.705-49.174-65.826Q-49.120-65.963-49.108-66.010L-48.788-67.299Q-49.252-66.885-49.725-66.885Q-50.081-66.885-50.350-67.065Q-50.620-67.244-50.760-67.539Q-50.901-67.834-50.901-68.193Q-50.901-68.580-50.739-68.994Q-50.577-69.408-50.293-69.746Q-50.010-70.084-49.641-70.287Q-49.272-70.490-48.870-70.490Q-48.620-70.490-48.403-70.352Q-48.186-70.213-48.069-69.986Q-48.006-70.096-47.799-70.293Q-47.592-70.490-47.495-70.490Q-47.448-70.490-47.415-70.455Q-47.381-70.420-47.381-70.369L-48.487-65.955Q-48.499-65.916-48.518-65.795Q-48.518-65.705-48.014-65.705Q-47.909-65.678-47.909-65.580L-47.940-65.475Q-47.948-65.432-48.030-65.412L-49.795-65.412Q-49.838-65.412-49.866-65.453Q-49.893-65.494-49.893-65.529M-49.709-67.139Q-49.409-67.139-49.129-67.346Q-48.850-67.553-48.655-67.842L-48.221-69.572Q-48.260-69.752-48.346-69.902Q-48.432-70.053-48.569-70.145Q-48.706-70.236-48.885-70.236Q-49.221-70.236-49.493-69.955Q-49.764-69.674-49.924-69.299Q-50.049-68.979-50.147-68.559Q-50.245-68.139-50.245-67.858Q-50.245-67.568-50.112-67.354Q-49.979-67.139-49.709-67.139",[955],[938,5551,5552],{"transform":5545},[545,5553],{"d":5554,"fill":2736,"stroke":2736,"className":5555,"style":2626},"M-44.530-64.971Q-45.143-65.428-45.545-66.063Q-45.948-66.697-46.143-67.443Q-46.338-68.190-46.338-68.963Q-46.338-69.736-46.143-70.483Q-45.948-71.229-45.545-71.863Q-45.143-72.498-44.530-72.955Q-44.518-72.959-44.510-72.961Q-44.502-72.963-44.491-72.963L-44.413-72.963Q-44.374-72.963-44.348-72.936Q-44.323-72.908-44.323-72.865Q-44.323-72.815-44.354-72.795Q-44.862-72.342-45.184-71.719Q-45.506-71.096-45.647-70.400Q-45.788-69.705-45.788-68.963Q-45.788-68.229-45.649-67.529Q-45.510-66.830-45.186-66.205Q-44.862-65.580-44.354-65.131Q-44.323-65.111-44.323-65.061Q-44.323-65.018-44.348-64.990Q-44.374-64.963-44.413-64.963L-44.491-64.963Q-44.499-64.967-44.508-64.969Q-44.518-64.971-44.530-64.971M-41.721-66.795Q-42.393-66.795-42.790-67.219Q-43.186-67.643-43.338-68.262Q-43.491-68.881-43.491-69.549Q-43.491-70.209-43.219-70.842Q-42.948-71.475-42.434-71.879Q-41.920-72.283-41.249-72.283Q-40.959-72.283-40.711-72.184Q-40.463-72.084-40.317-71.883Q-40.170-71.682-40.170-71.377Q-40.170-71.272-40.221-71.180Q-40.272-71.088-40.364-71.037Q-40.456-70.986-40.561-70.986Q-40.729-70.986-40.842-71.100Q-40.956-71.213-40.956-71.377Q-40.956-71.537-40.846-71.654Q-40.737-71.772-40.569-71.772Q-40.768-72.041-41.249-72.041Q-41.667-72.041-41.999-71.764Q-42.331-71.486-42.506-71.068Q-42.706-70.568-42.706-69.666Q-42.542-69.990-42.262-70.190Q-41.983-70.389-41.635-70.389Q-41.151-70.389-40.766-70.143Q-40.381-69.897-40.168-69.488Q-39.956-69.080-39.956-68.596Q-39.956-68.104-40.186-67.692Q-40.417-67.279-40.827-67.037Q-41.237-66.795-41.721-66.795M-41.721-67.068Q-41.295-67.068-41.079-67.289Q-40.862-67.510-40.799-67.836Q-40.737-68.162-40.737-68.596Q-40.737-68.908-40.762-69.158Q-40.788-69.408-40.877-69.633Q-40.967-69.858-41.163-69.994Q-41.358-70.131-41.674-70.131Q-42.002-70.131-42.235-69.922Q-42.467-69.713-42.579-69.395Q-42.690-69.076-42.690-68.764Q-42.686-68.725-42.684-68.692Q-42.682-68.658-42.682-68.604Q-42.682-68.588-42.684-68.580Q-42.686-68.572-42.690-68.565Q-42.690-67.990-42.463-67.529Q-42.237-67.068-41.721-67.068M-38.956-64.963L-39.038-64.963Q-39.073-64.963-39.098-64.992Q-39.124-65.022-39.124-65.061Q-39.124-65.111-39.092-65.131Q-38.706-65.467-38.422-65.916Q-38.139-66.365-37.973-66.865Q-37.807-67.365-37.733-67.883Q-37.659-68.400-37.659-68.963Q-37.659-69.533-37.733-70.049Q-37.807-70.565-37.973-71.061Q-38.139-71.557-38.418-72.004Q-38.698-72.451-39.092-72.795Q-39.124-72.815-39.124-72.865Q-39.124-72.904-39.098-72.934Q-39.073-72.963-39.038-72.963L-38.956-72.963Q-38.944-72.963-38.934-72.961Q-38.924-72.959-38.917-72.955Q-38.303-72.498-37.901-71.863Q-37.499-71.229-37.303-70.483Q-37.108-69.736-37.108-68.963Q-37.108-68.190-37.303-67.443Q-37.499-66.697-37.901-66.063Q-38.303-65.428-38.917-64.971Q-38.928-64.971-38.936-64.969Q-38.944-64.967-38.956-64.963",[955],[938,5557,5558],{"transform":5545},[545,5559],{"d":5560,"fill":2736,"stroke":2736,"className":5561,"style":2626},"M-27.964-67.940L-33.277-67.940Q-33.355-67.947-33.404-67.996Q-33.452-68.045-33.452-68.123Q-33.452-68.193-33.405-68.244Q-33.359-68.295-33.277-68.307L-27.964-68.307Q-27.890-68.295-27.843-68.244Q-27.796-68.193-27.796-68.123Q-27.796-68.045-27.845-67.996Q-27.894-67.947-27.964-67.940M-27.964-69.627L-33.277-69.627Q-33.355-69.635-33.404-69.684Q-33.452-69.733-33.452-69.811Q-33.452-69.881-33.405-69.932Q-33.359-69.983-33.277-69.994L-27.964-69.994Q-27.890-69.983-27.843-69.932Q-27.796-69.881-27.796-69.811Q-27.796-69.733-27.845-69.684Q-27.894-69.635-27.964-69.627",[955],[938,5563,5564],{"transform":5545},[545,5565],{"d":5566,"fill":2736,"stroke":2736,"className":5567,"style":2626},"M-24.159-67.596Q-23.968-67.322-23.612-67.195Q-23.257-67.068-22.874-67.068Q-22.538-67.068-22.329-67.254Q-22.120-67.440-22.024-67.733Q-21.929-68.025-21.929-68.338Q-21.929-68.662-22.026-68.957Q-22.124-69.252-22.337-69.436Q-22.550-69.619-22.882-69.619L-23.448-69.619Q-23.479-69.619-23.509-69.649Q-23.538-69.678-23.538-69.705L-23.538-69.787Q-23.538-69.822-23.509-69.848Q-23.479-69.873-23.448-69.873L-22.968-69.908Q-22.682-69.908-22.485-70.113Q-22.288-70.318-22.192-70.613Q-22.097-70.908-22.097-71.186Q-22.097-71.565-22.296-71.803Q-22.495-72.041-22.874-72.041Q-23.194-72.041-23.483-71.934Q-23.772-71.826-23.936-71.604Q-23.757-71.604-23.634-71.477Q-23.511-71.350-23.511-71.178Q-23.511-71.006-23.636-70.881Q-23.761-70.756-23.936-70.756Q-24.108-70.756-24.233-70.881Q-24.358-71.006-24.358-71.178Q-24.358-71.545-24.134-71.793Q-23.909-72.041-23.569-72.162Q-23.229-72.283-22.874-72.283Q-22.526-72.283-22.163-72.162Q-21.800-72.041-21.552-71.791Q-21.304-71.541-21.304-71.186Q-21.304-70.701-21.622-70.318Q-21.940-69.936-22.417-69.764Q-21.866-69.654-21.466-69.268Q-21.065-68.881-21.065-68.346Q-21.065-67.889-21.329-67.533Q-21.593-67.178-22.015-66.986Q-22.436-66.795-22.874-66.795Q-23.284-66.795-23.677-66.930Q-24.069-67.065-24.335-67.350Q-24.600-67.635-24.600-68.053Q-24.600-68.248-24.468-68.377Q-24.335-68.506-24.143-68.506Q-24.018-68.506-23.915-68.447Q-23.811-68.389-23.749-68.283Q-23.686-68.178-23.686-68.053Q-23.686-67.858-23.821-67.727Q-23.956-67.596-24.159-67.596",[955],[938,5569,5570],{"transform":5545},[545,5571],{"d":5572,"fill":2736,"stroke":2736,"className":5573,"style":2626},"M-49.195-55.471Q-49.808-55.928-50.210-56.563Q-50.613-57.197-50.808-57.943Q-51.003-58.690-51.003-59.463Q-51.003-60.236-50.808-60.983Q-50.613-61.729-50.210-62.363Q-49.808-62.998-49.195-63.455Q-49.183-63.459-49.175-63.461Q-49.167-63.463-49.156-63.463L-49.078-63.463Q-49.039-63.463-49.013-63.436Q-48.988-63.408-48.988-63.365Q-48.988-63.315-49.019-63.295Q-49.527-62.842-49.849-62.219Q-50.171-61.596-50.312-60.901Q-50.453-60.205-50.453-59.463Q-50.453-58.729-50.314-58.029Q-50.175-57.330-49.851-56.705Q-49.527-56.080-49.019-55.631Q-48.988-55.611-48.988-55.561Q-48.988-55.518-49.013-55.490Q-49.039-55.463-49.078-55.463L-49.156-55.463Q-49.164-55.467-49.173-55.469Q-49.183-55.471-49.195-55.471M-46.355-57.463L-48.187-57.463L-48.187-57.760Q-47.914-57.760-47.746-57.807Q-47.578-57.854-47.578-58.022L-47.578-62.182Q-47.578-62.397-47.640-62.492Q-47.703-62.588-47.822-62.609Q-47.941-62.631-48.187-62.631L-48.187-62.928L-46.964-63.014L-46.964-58.022Q-46.964-57.854-46.796-57.807Q-46.628-57.760-46.355-57.760L-46.355-57.463M-45.812-58.295Q-45.812-58.779-45.410-59.074Q-45.007-59.369-44.457-59.488Q-43.906-59.608-43.414-59.608L-43.414-59.897Q-43.414-60.123-43.529-60.330Q-43.644-60.537-43.841-60.656Q-44.039-60.776-44.269-60.776Q-44.695-60.776-44.980-60.670Q-44.910-60.643-44.863-60.588Q-44.816-60.533-44.791-60.463Q-44.765-60.393-44.765-60.318Q-44.765-60.213-44.816-60.121Q-44.867-60.029-44.958-59.979Q-45.050-59.928-45.156-59.928Q-45.261-59.928-45.353-59.979Q-45.445-60.029-45.496-60.121Q-45.546-60.213-45.546-60.318Q-45.546-60.736-45.158-60.883Q-44.769-61.029-44.269-61.029Q-43.937-61.029-43.583-60.899Q-43.230-60.768-43.001-60.514Q-42.773-60.260-42.773-59.912L-42.773-58.111Q-42.773-57.979-42.701-57.869Q-42.628-57.760-42.499-57.760Q-42.374-57.760-42.306-57.865Q-42.238-57.971-42.238-58.111L-42.238-58.623L-41.957-58.623L-41.957-58.111Q-41.957-57.908-42.074-57.750Q-42.191-57.592-42.373-57.508Q-42.554-57.424-42.757-57.424Q-42.988-57.424-43.140-57.596Q-43.292-57.768-43.324-57.998Q-43.484-57.717-43.792-57.551Q-44.101-57.385-44.453-57.385Q-44.964-57.385-45.388-57.608Q-45.812-57.830-45.812-58.295M-45.124-58.295Q-45.124-58.010-44.898-57.824Q-44.671-57.639-44.378-57.639Q-44.132-57.639-43.908-57.756Q-43.683-57.873-43.548-58.076Q-43.414-58.279-43.414-58.533L-43.414-59.365Q-43.679-59.365-43.964-59.311Q-44.249-59.256-44.521-59.127Q-44.792-58.998-44.958-58.791Q-45.124-58.584-45.124-58.295M-41.621-57.471L-41.621-58.693Q-41.621-58.721-41.589-58.752Q-41.558-58.783-41.535-58.783L-41.429-58.783Q-41.359-58.783-41.343-58.721Q-41.281-58.401-41.142-58.160Q-41.003-57.920-40.771-57.779Q-40.539-57.639-40.230-57.639Q-39.992-57.639-39.783-57.699Q-39.574-57.760-39.437-57.908Q-39.300-58.057-39.300-58.303Q-39.300-58.557-39.511-58.723Q-39.722-58.889-39.992-58.943L-40.613-59.057Q-41.019-59.135-41.320-59.391Q-41.621-59.647-41.621-60.022Q-41.621-60.389-41.419-60.611Q-41.218-60.834-40.894-60.932Q-40.570-61.029-40.230-61.029Q-39.765-61.029-39.468-60.822L-39.246-61.006Q-39.222-61.029-39.191-61.029L-39.140-61.029Q-39.109-61.029-39.082-61.002Q-39.054-60.975-39.054-60.943L-39.054-59.959Q-39.054-59.928-39.080-59.899Q-39.105-59.869-39.140-59.869L-39.246-59.869Q-39.281-59.869-39.308-59.897Q-39.335-59.924-39.335-59.959Q-39.335-60.358-39.587-60.578Q-39.839-60.799-40.238-60.799Q-40.593-60.799-40.876-60.676Q-41.160-60.553-41.160-60.248Q-41.160-60.029-40.958-59.897Q-40.757-59.764-40.511-59.721L-39.886-59.608Q-39.457-59.518-39.148-59.221Q-38.839-58.924-38.839-58.510Q-38.839-57.940-39.238-57.662Q-39.636-57.385-40.230-57.385Q-40.781-57.385-41.132-57.721L-41.429-57.408Q-41.453-57.385-41.488-57.385L-41.535-57.385Q-41.558-57.385-41.589-57.416Q-41.621-57.447-41.621-57.471M-37.687-58.424L-37.687-60.615L-38.390-60.615L-38.390-60.869Q-38.035-60.869-37.792-61.102Q-37.550-61.334-37.439-61.682Q-37.328-62.029-37.328-62.385L-37.046-62.385L-37.046-60.912L-35.871-60.912L-35.871-60.615L-37.046-60.615L-37.046-58.440Q-37.046-58.119-36.927-57.891Q-36.808-57.662-36.527-57.662Q-36.347-57.662-36.230-57.785Q-36.113-57.908-36.060-58.088Q-36.007-58.268-36.007-58.440L-36.007-58.912L-35.726-58.912L-35.726-58.424Q-35.726-58.170-35.832-57.930Q-35.937-57.690-36.134-57.537Q-36.332-57.385-36.589-57.385Q-36.906-57.385-37.158-57.508Q-37.410-57.631-37.548-57.865Q-37.687-58.100-37.687-58.424",[955],[938,5575,5576],{"transform":5545},[545,5577],{"d":5578,"fill":2736,"stroke":2736,"className":5579,"style":2626},"M-31.252-57.463L-31.533-57.463L-31.533-62.182Q-31.533-62.397-31.595-62.492Q-31.658-62.588-31.775-62.609Q-31.892-62.631-32.138-62.631L-32.138-62.928L-30.916-63.014L-30.916-60.526Q-30.439-60.990-29.740-60.990Q-29.259-60.990-28.851-60.746Q-28.443-60.502-28.207-60.088Q-27.970-59.674-27.970-59.190Q-27.970-58.815-28.119-58.486Q-28.267-58.158-28.537-57.906Q-28.806-57.654-29.150-57.520Q-29.494-57.385-29.853-57.385Q-30.174-57.385-30.472-57.533Q-30.771-57.682-30.978-57.943L-31.252-57.463M-30.892-60.135L-30.892-58.295Q-30.740-57.998-30.480-57.818Q-30.220-57.639-29.908-57.639Q-29.482-57.639-29.215-57.858Q-28.947-58.076-28.832-58.422Q-28.717-58.768-28.717-59.190Q-28.717-59.838-28.965-60.287Q-29.213-60.736-29.810-60.736Q-30.146-60.736-30.435-60.578Q-30.724-60.420-30.892-60.135M-27.349-58.295Q-27.349-58.779-26.947-59.074Q-26.545-59.369-25.994-59.488Q-25.443-59.608-24.951-59.608L-24.951-59.897Q-24.951-60.123-25.066-60.330Q-25.181-60.537-25.379-60.656Q-25.576-60.776-25.806-60.776Q-26.232-60.776-26.517-60.670Q-26.447-60.643-26.400-60.588Q-26.353-60.533-26.328-60.463Q-26.302-60.393-26.302-60.318Q-26.302-60.213-26.353-60.121Q-26.404-60.029-26.496-59.979Q-26.588-59.928-26.693-59.928Q-26.799-59.928-26.890-59.979Q-26.982-60.029-27.033-60.121Q-27.084-60.213-27.084-60.318Q-27.084-60.736-26.695-60.883Q-26.306-61.029-25.806-61.029Q-25.474-61.029-25.121-60.899Q-24.767-60.768-24.539-60.514Q-24.310-60.260-24.310-59.912L-24.310-58.111Q-24.310-57.979-24.238-57.869Q-24.166-57.760-24.037-57.760Q-23.912-57.760-23.843-57.865Q-23.775-57.971-23.775-58.111L-23.775-58.623L-23.494-58.623L-23.494-58.111Q-23.494-57.908-23.611-57.750Q-23.728-57.592-23.910-57.508Q-24.092-57.424-24.295-57.424Q-24.525-57.424-24.677-57.596Q-24.830-57.768-24.861-57.998Q-25.021-57.717-25.330-57.551Q-25.638-57.385-25.990-57.385Q-26.502-57.385-26.925-57.608Q-27.349-57.830-27.349-58.295M-26.662-58.295Q-26.662-58.010-26.435-57.824Q-26.209-57.639-25.916-57.639Q-25.670-57.639-25.445-57.756Q-25.220-57.873-25.086-58.076Q-24.951-58.279-24.951-58.533L-24.951-59.365Q-25.217-59.365-25.502-59.311Q-25.787-59.256-26.058-59.127Q-26.330-58.998-26.496-58.791Q-26.662-58.584-26.662-58.295M-21.193-57.463L-23.174-57.463L-23.174-57.760Q-22.904-57.760-22.736-57.805Q-22.568-57.850-22.568-58.022L-22.568-60.158Q-22.568-60.373-22.631-60.469Q-22.693-60.565-22.810-60.586Q-22.927-60.608-23.174-60.608L-23.174-60.904L-22.006-60.990L-22.006-60.205Q-21.927-60.416-21.775-60.602Q-21.623-60.787-21.424-60.889Q-21.224-60.990-20.998-60.990Q-20.752-60.990-20.560-60.846Q-20.369-60.701-20.369-60.471Q-20.369-60.315-20.474-60.205Q-20.580-60.096-20.736-60.096Q-20.892-60.096-21.002-60.205Q-21.111-60.315-21.111-60.471Q-21.111-60.631-21.006-60.736Q-21.330-60.736-21.545-60.508Q-21.759-60.279-21.855-59.940Q-21.951-59.600-21.951-59.295L-21.951-58.022Q-21.951-57.854-21.724-57.807Q-21.498-57.760-21.193-57.760",[955],[938,5581,5582],{"transform":5545},[545,5583],{"d":5584,"fill":2736,"stroke":2736,"className":5585,"style":2626},"M-51.670-47.963L-53.502-47.963L-53.502-48.260Q-53.228-48.260-53.060-48.307Q-52.892-48.354-52.892-48.522L-52.892-52.682Q-52.892-52.897-52.955-52.992Q-53.017-53.088-53.136-53.109Q-53.256-53.131-53.502-53.131L-53.502-53.428L-52.279-53.514L-52.279-48.522Q-52.279-48.354-52.111-48.307Q-51.943-48.260-51.670-48.260L-51.670-47.963M-51.224-49.717Q-51.224-50.197-50.992-50.613Q-50.760-51.029-50.349-51.279Q-49.939-51.529-49.463-51.529Q-48.732-51.529-48.334-51.088Q-47.935-50.647-47.935-49.916Q-47.935-49.811-48.029-49.787L-50.478-49.787L-50.478-49.717Q-50.478-49.307-50.357-48.951Q-50.236-48.596-49.965-48.379Q-49.693-48.162-49.263-48.162Q-48.900-48.162-48.603-48.391Q-48.306-48.619-48.205-48.971Q-48.197-49.018-48.111-49.033L-48.029-49.033Q-47.935-49.006-47.935-48.924Q-47.935-48.916-47.943-48.885Q-48.006-48.658-48.144-48.475Q-48.283-48.291-48.474-48.158Q-48.666-48.026-48.885-47.955Q-49.103-47.885-49.342-47.885Q-49.713-47.885-50.051-48.022Q-50.388-48.158-50.656-48.410Q-50.924-48.662-51.074-49.002Q-51.224-49.342-51.224-49.717M-50.470-50.026L-48.510-50.026Q-48.510-50.330-48.611-50.621Q-48.713-50.912-48.929-51.094Q-49.146-51.276-49.463-51.276Q-49.763-51.276-49.994-51.088Q-50.224-50.901-50.347-50.609Q-50.470-50.318-50.470-50.026M-45.381-47.963L-47.365-47.963L-47.365-48.260Q-47.092-48.260-46.924-48.307Q-46.756-48.354-46.756-48.522L-46.756-51.115L-47.396-51.115L-47.396-51.412L-46.756-51.412L-46.756-52.346Q-46.756-52.611-46.638-52.848Q-46.521-53.084-46.328-53.248Q-46.135-53.412-45.886-53.504Q-45.638-53.596-45.373-53.596Q-45.088-53.596-44.863-53.438Q-44.638-53.279-44.638-53.002Q-44.638-52.846-44.744-52.736Q-44.849-52.627-45.013-52.627Q-45.170-52.627-45.279-52.736Q-45.388-52.846-45.388-53.002Q-45.388-53.209-45.228-53.315Q-45.326-53.338-45.420-53.338Q-45.650-53.338-45.822-53.182Q-45.994-53.026-46.080-52.789Q-46.166-52.553-46.166-52.330L-46.166-51.412L-45.197-51.412L-45.197-51.115L-46.142-51.115L-46.142-48.522Q-46.142-48.354-45.916-48.307Q-45.689-48.260-45.381-48.260L-45.381-47.963M-44.228-48.924L-44.228-51.115L-44.931-51.115L-44.931-51.369Q-44.576-51.369-44.334-51.602Q-44.092-51.834-43.980-52.182Q-43.869-52.529-43.869-52.885L-43.588-52.885L-43.588-51.412L-42.412-51.412L-42.412-51.115L-43.588-51.115L-43.588-48.940Q-43.588-48.619-43.468-48.391Q-43.349-48.162-43.068-48.162Q-42.888-48.162-42.771-48.285Q-42.654-48.408-42.601-48.588Q-42.549-48.768-42.549-48.940L-42.549-49.412L-42.267-49.412L-42.267-48.924Q-42.267-48.670-42.373-48.430Q-42.478-48.190-42.676-48.037Q-42.873-47.885-43.131-47.885Q-43.447-47.885-43.699-48.008Q-43.951-48.131-44.090-48.365Q-44.228-48.600-44.228-48.924",[955],[938,5587,5588],{"transform":5545},[545,5589],{"d":5590,"fill":2736,"stroke":2736,"className":5591,"style":2626},"M-38.709-49.658Q-38.709-50.162-38.453-50.594Q-38.197-51.026-37.761-51.277Q-37.326-51.529-36.826-51.529Q-36.439-51.529-36.097-51.385Q-35.756-51.240-35.494-50.979Q-35.232-50.717-35.090-50.381Q-34.947-50.045-34.947-49.658Q-34.947-49.166-35.211-48.756Q-35.474-48.346-35.904-48.115Q-36.334-47.885-36.826-47.885Q-37.318-47.885-37.752-48.117Q-38.185-48.350-38.447-48.758Q-38.709-49.166-38.709-49.658M-36.826-48.162Q-36.369-48.162-36.117-48.385Q-35.865-48.608-35.777-48.959Q-35.689-49.311-35.689-49.756Q-35.689-50.186-35.783-50.524Q-35.877-50.861-36.131-51.068Q-36.385-51.276-36.826-51.276Q-37.474-51.276-37.718-50.859Q-37.963-50.443-37.963-49.756Q-37.963-49.311-37.875-48.959Q-37.787-48.608-37.535-48.385Q-37.283-48.162-36.826-48.162M-32.396-47.963L-34.381-47.963L-34.381-48.260Q-34.107-48.260-33.939-48.307Q-33.771-48.354-33.771-48.522L-33.771-51.115L-34.412-51.115L-34.412-51.412L-33.771-51.412L-33.771-52.346Q-33.771-52.611-33.654-52.848Q-33.537-53.084-33.343-53.248Q-33.150-53.412-32.902-53.504Q-32.654-53.596-32.388-53.596Q-32.103-53.596-31.879-53.438Q-31.654-53.279-31.654-53.002Q-31.654-52.846-31.760-52.736Q-31.865-52.627-32.029-52.627Q-32.185-52.627-32.295-52.736Q-32.404-52.846-32.404-53.002Q-32.404-53.209-32.244-53.315Q-32.342-53.338-32.435-53.338Q-32.666-53.338-32.838-53.182Q-33.010-53.026-33.095-52.789Q-33.181-52.553-33.181-52.330L-33.181-51.412L-32.213-51.412L-32.213-51.115L-33.158-51.115L-33.158-48.522Q-33.158-48.354-32.931-48.307Q-32.705-48.260-32.396-48.260",[955],[938,5593,5594],{"transform":5545},[545,5595],{"d":5596,"fill":2736,"stroke":2736,"className":5597,"style":2626},"M-26.587-47.963L-28.826-47.963Q-28.869-47.963-28.896-48.004Q-28.923-48.045-28.923-48.092L-28.900-48.193Q-28.892-48.240-28.802-48.260Q-28.587-48.260-28.417-48.270Q-28.247-48.279-28.162-48.299Q-28.005-48.338-27.962-48.565L-26.884-52.885Q-26.861-52.943-26.861-53.010Q-26.861-53.076-26.931-53.100Q-27.083-53.131-27.533-53.131Q-27.634-53.158-27.634-53.260L-27.603-53.361Q-27.595-53.408-27.513-53.428L-25.275-53.428Q-25.240-53.428-25.208-53.387Q-25.177-53.346-25.177-53.307L-25.204-53.201Q-25.224-53.147-25.298-53.131Q-25.771-53.131-25.939-53.092Q-26.087-53.057-26.146-52.826L-27.228-48.506Q-27.244-48.428-27.244-48.377Q-27.244-48.311-27.177-48.291Q-27.021-48.260-26.572-48.260Q-26.474-48.233-26.474-48.139L-26.497-48.033Q-26.505-47.983-26.587-47.963",[955],[938,5599,5600],{"transform":5545},[545,5601],{"d":5602,"fill":2736,"stroke":2736,"className":5603,"style":1972},"M-23.750-46.726Q-24.160-46.726-24.444-46.905Q-24.728-47.083-24.897-47.391Q-25.065-47.699-25.134-48.060Q-25.203-48.422-25.203-48.791Q-25.203-49.307-24.970-49.783Q-24.737-50.259-24.317-50.551Q-23.896-50.842-23.360-50.842Q-22.988-50.842-22.730-50.675Q-22.473-50.508-22.473-50.151Q-22.473-50.022-22.558-49.937Q-22.643-49.852-22.774-49.852Q-22.903-49.852-22.991-49.937Q-23.079-50.022-23.079-50.151Q-23.079-50.262-23.009-50.346Q-22.938-50.429-22.833-50.453Q-22.994-50.620-23.360-50.620Q-23.662-50.620-23.915-50.463Q-24.169-50.306-24.333-50.045Q-24.474-49.802-24.526-49.505Q-24.579-49.207-24.579-48.873Q-24.239-49.421-23.674-49.421Q-23.296-49.421-22.982-49.246Q-22.669-49.070-22.484-48.765Q-22.300-48.460-22.300-48.082Q-22.300-47.690-22.499-47.379Q-22.698-47.069-23.032-46.897Q-23.366-46.726-23.750-46.726M-23.750-46.966Q-23.416-46.966-23.231-47.113Q-23.047-47.259-22.985-47.497Q-22.924-47.734-22.924-48.071L-22.924-48.088Q-22.924-48.604-23.081-48.904Q-23.237-49.205-23.709-49.205Q-23.964-49.205-24.159-49.060Q-24.353-48.914-24.457-48.686Q-24.561-48.457-24.561-48.208Q-24.561-48.129-24.556-48.088Q-24.556-48.068-24.559-48.068Q-24.561-48.068-24.561-48.047Q-24.561-47.617-24.361-47.291Q-24.160-46.966-23.750-46.966",[955],[938,5605,5606],{"transform":5545},[545,5607],{"d":5608,"fill":2736,"stroke":2736,"className":5609,"style":2626},"M-20.773-45.963L-20.855-45.963Q-20.891-45.963-20.916-45.992Q-20.941-46.022-20.941-46.061Q-20.941-46.111-20.910-46.131Q-20.523-46.467-20.240-46.916Q-19.957-47.365-19.791-47.865Q-19.625-48.365-19.551-48.883Q-19.477-49.401-19.477-49.963Q-19.477-50.533-19.551-51.049Q-19.625-51.565-19.791-52.061Q-19.957-52.557-20.236-53.004Q-20.516-53.451-20.910-53.795Q-20.941-53.815-20.941-53.865Q-20.941-53.904-20.916-53.934Q-20.891-53.963-20.855-53.963L-20.773-53.963Q-20.762-53.963-20.752-53.961Q-20.742-53.959-20.734-53.955Q-20.121-53.498-19.719-52.863Q-19.316-52.229-19.121-51.483Q-18.926-50.736-18.926-49.963Q-18.926-49.190-19.121-48.443Q-19.316-47.697-19.719-47.063Q-20.121-46.428-20.734-45.971Q-20.746-45.971-20.754-45.969Q-20.762-45.967-20.773-45.963",[955],[1197,5611,5613,5614,5638,5639,5691,5692,5735,5736,5788,5789,392],{"className":5612},[1200],"Intervals sorted by finish time; ",[421,5615,5617],{"className":5616},[428],[421,5618,5620],{"className":5619,"ariaHidden":433},[432],[421,5621,5623,5626,5629,5632,5635],{"className":5622},[437],[421,5624],{"className":5625,"style":442},[441],[421,5627,4782],{"className":5628,"style":4781},[446,447],[421,5630,454],{"className":5631},[453],[421,5633,3023],{"className":5634},[446,447],[421,5636,463],{"className":5637},[462]," is the rightmost interval ending before ",[421,5640,5642],{"className":5641},[428],[421,5643,5645],{"className":5644,"ariaHidden":433},[432],[421,5646,5648,5651],{"className":5647},[437],[421,5649],{"className":5650,"style":1242},[441],[421,5652,5654,5657],{"className":5653},[446],[421,5655,3339],{"className":5656,"style":3338},[446,447],[421,5658,5660],{"className":5659},[1252],[421,5661,5663,5683],{"className":5662},[499,500],[421,5664,5666,5680],{"className":5665},[504],[421,5667,5669],{"className":5668,"style":3468},[508],[421,5670,5671,5674],{"style":3354},[421,5672],{"className":5673,"style":1269},[516],[421,5675,5677],{"className":5676},[1273,1274,1275,1276],[421,5678,3023],{"className":5679},[446,447,1276],[421,5681,588],{"className":5682},[587],[421,5684,5686],{"className":5685},[504],[421,5687,5689],{"className":5688,"style":1290},[508],[421,5690],{}," starts. Here ",[421,5693,5695],{"className":5694},[428],[421,5696,5698,5726],{"className":5697,"ariaHidden":433},[432],[421,5699,5701,5704,5707,5710,5714,5717,5720,5723],{"className":5700},[437],[421,5702],{"className":5703,"style":442},[441],[421,5705,4782],{"className":5706,"style":4781},[446,447],[421,5708,454],{"className":5709},[453],[421,5711,5713],{"className":5712},[446],"6",[421,5715,463],{"className":5716},[462],[421,5718],{"className":5719,"style":468},[467],[421,5721,473],{"className":5722},[472],[421,5724],{"className":5725,"style":468},[467],[421,5727,5729,5732],{"className":5728},[437],[421,5730],{"className":5731,"style":1560},[441],[421,5733,1280],{"className":5734},[446],": interval ",[421,5737,5739],{"className":5738},[428],[421,5740,5742],{"className":5741,"ariaHidden":433},[432],[421,5743,5745,5748],{"className":5744},[437],[421,5746],{"className":5747,"style":1242},[441],[421,5749,5751,5754],{"className":5750},[446],[421,5752,3339],{"className":5753,"style":3338},[446,447],[421,5755,5757],{"className":5756},[1252],[421,5758,5760,5780],{"className":5759},[499,500],[421,5761,5763,5777],{"className":5762},[504],[421,5764,5766],{"className":5765,"style":1262},[508],[421,5767,5768,5771],{"style":3354},[421,5769],{"className":5770,"style":1269},[516],[421,5772,5774],{"className":5773},[1273,1274,1275,1276],[421,5775,1280],{"className":5776},[446,1276],[421,5778,588],{"className":5779},[587],[421,5781,5783],{"className":5782},[504],[421,5784,5786],{"className":5785,"style":1290},[508],[421,5787],{}," is the last one entirely left of ",[421,5790,5792],{"className":5791},[428],[421,5793,5795],{"className":5794,"ariaHidden":433},[432],[421,5796,5798,5801],{"className":5797},[437],[421,5799],{"className":5800,"style":1242},[441],[421,5802,5804,5807],{"className":5803},[446],[421,5805,3339],{"className":5806,"style":3338},[446,447],[421,5808,5810],{"className":5809},[1252],[421,5811,5813,5833],{"className":5812},[499,500],[421,5814,5816,5830],{"className":5815},[504],[421,5817,5819],{"className":5818,"style":1262},[508],[421,5820,5821,5824],{"style":3354},[421,5822],{"className":5823,"style":1269},[516],[421,5825,5827],{"className":5826},[1273,1274,1275,1276],[421,5828,5713],{"className":5829},[446,1276],[421,5831,588],{"className":5832},[587],[421,5834,5836],{"className":5835},[504],[421,5837,5839],{"className":5838,"style":1290},[508],[421,5840],{},[381,5842,5843,5846,5847,5899,5900,4840],{},[384,5844,5845],{},"Step 3: DP equations."," Consider the last interval ",[421,5848,5850],{"className":5849},[428],[421,5851,5853],{"className":5852,"ariaHidden":433},[432],[421,5854,5856,5859],{"className":5855},[437],[421,5857],{"className":5858,"style":1242},[441],[421,5860,5862,5865],{"className":5861},[446],[421,5863,3339],{"className":5864,"style":3338},[446,447],[421,5866,5868],{"className":5867},[1252],[421,5869,5871,5891],{"className":5870},[499,500],[421,5872,5874,5888],{"className":5873},[504],[421,5875,5877],{"className":5876,"style":3468},[508],[421,5878,5879,5882],{"style":3354},[421,5880],{"className":5881,"style":1269},[516],[421,5883,5885],{"className":5884},[1273,1274,1275,1276],[421,5886,3023],{"className":5887},[446,447,1276],[421,5889,588],{"className":5890},[587],[421,5892,5894],{"className":5893},[504],[421,5895,5897],{"className":5896,"style":1290},[508],[421,5898],{}," and make one binary\nchoice — ",[384,5901,5902],{},"include it or not",[421,5904,5906],{"className":5905},[424],[421,5907,5909],{"className":5908},[428],[421,5910,5912,5945],{"className":5911,"ariaHidden":433},[432],[421,5913,5915,5918,5927,5930,5933,5936,5939,5942],{"className":5914},[437],[421,5916],{"className":5917,"style":442},[441],[421,5919,5921],{"className":5920},[1582,1583],[421,5922,5924],{"className":5923},[446,756],[421,5925,3162],{"className":5926},[446],[421,5928,454],{"className":5929},[453],[421,5931,3023],{"className":5932},[446,447],[421,5934,463],{"className":5935},[462],[421,5937],{"className":5938,"style":468},[467],[421,5940,473],{"className":5941},[472],[421,5943],{"className":5944,"style":468},[467],[421,5946,5948,5952],{"className":5947},[437],[421,5949],{"className":5950,"style":5951},[441],"height:4.92em;vertical-align:-2.21em;",[421,5953,5955,6033,6484],{"className":5954},[487],[421,5956,5958],{"className":5957},[453],[421,5959,5961],{"className":5960},[494,495],[421,5962,5964,6025],{"className":5963},[499,500],[421,5965,5967,6022],{"className":5966},[504],[421,5968,5970,5980,5991,6001,6012],{"className":5969,"style":509},[508],[421,5971,5972,5975],{"style":512},[421,5973],{"className":5974,"style":517},[516],[421,5976,5978],{"className":5977},[521,522],[421,5979,525],{},[421,5981,5982,5985],{"style":528},[421,5983],{"className":5984,"style":517},[516],[421,5986,5987],{"style":534},[536,5988,5989],{"xmlns":538,"width":539,"height":540,"style":541,"viewBox":542,"preserveAspectRatio":543},[545,5990],{"d":547},[421,5992,5993,5996],{"style":550},[421,5994],{"className":5995,"style":517},[516],[421,5997,5999],{"className":5998},[521,522],[421,6000,559],{},[421,6002,6003,6006],{"style":562},[421,6004],{"className":6005,"style":517},[516],[421,6007,6008],{"style":534},[536,6009,6010],{"xmlns":538,"width":539,"height":540,"style":541,"viewBox":542,"preserveAspectRatio":543},[545,6011],{"d":547},[421,6013,6014,6017],{"style":574},[421,6015],{"className":6016,"style":517},[516],[421,6018,6020],{"className":6019},[521,522],[421,6021,583],{},[421,6023,588],{"className":6024},[587],[421,6026,6028],{"className":6027},[504],[421,6029,6031],{"className":6030,"style":595},[508],[421,6032],{},[421,6034,6036],{"className":6035},[446],[421,6037,6039,6396,6399],{"className":6038},[604],[421,6040,6042],{"className":6041},[608],[421,6043,6045,6387],{"className":6044},[499,500],[421,6046,6048,6384],{"className":6047},[504],[421,6049,6052,6065],{"className":6050,"style":6051},[508],"height:2.71em;",[421,6053,6055,6059],{"style":6054},"top:-5.492em;",[421,6056],{"className":6057,"style":6058},[516],"height:3.79em;",[421,6060,6062],{"className":6061},[446],[421,6063,632],{"className":6064},[446],[421,6066,6068,6071],{"style":6067},"top:-2.87em;",[421,6069],{"className":6070,"style":6058},[516],[421,6072,6074,6080,6083],{"className":6073},[446],[421,6075,6077],{"className":6076},[4811],[421,6078,4816],{"className":6079},[446,4815],[421,6081],{"className":6082,"style":1715},[467],[421,6084,6086,6093,6381],{"className":6085},[487],[421,6087,6089],{"className":6088,"style":3682},[453,3681],[421,6090,3683],{"className":6091},[494,6092],"size4",[421,6094,6096],{"className":6095},[446],[421,6097,6099,6245,6248],{"className":6098},[604],[421,6100,6102],{"className":6101},[608],[421,6103,6105,6236],{"className":6104},[499,500],[421,6106,6108,6233],{"className":6107},[504],[421,6109,6112,6151],{"className":6110,"style":6111},[508],"height:1.79em;",[421,6113,6115,6118],{"style":6114},"top:-3.79em;",[421,6116],{"className":6117,"style":625},[516],[421,6119,6121,6130,6133,6136,6139,6142,6145,6148],{"className":6120},[446],[421,6122,6124],{"className":6123},[1582,1583],[421,6125,6127],{"className":6126},[446,756],[421,6128,3162],{"className":6129},[446],[421,6131,454],{"className":6132},[453],[421,6134,3023],{"className":6135},[446,447],[421,6137],{"className":6138,"style":666},[467],[421,6140,671],{"className":6141},[670],[421,6143],{"className":6144,"style":666},[467],[421,6146,403],{"className":6147},[446],[421,6149,463],{"className":6150},[462],[421,6152,6154,6157],{"style":6153},"top:-2.15em;",[421,6155],{"className":6156,"style":625},[516],[421,6158,6160,6200,6203,6206,6209,6218,6221,6224,6227,6230],{"className":6159},[446],[421,6161,6163,6166],{"className":6162},[446],[421,6164,381],{"className":6165},[446,447],[421,6167,6169],{"className":6168},[1252],[421,6170,6172,6192],{"className":6171},[499,500],[421,6173,6175,6189],{"className":6174},[504],[421,6176,6178],{"className":6177,"style":3468},[508],[421,6179,6180,6183],{"style":3530},[421,6181],{"className":6182,"style":1269},[516],[421,6184,6186],{"className":6185},[1273,1274,1275,1276],[421,6187,3023],{"className":6188},[446,447,1276],[421,6190,588],{"className":6191},[587],[421,6193,6195],{"className":6194},[504],[421,6196,6198],{"className":6197,"style":1290},[508],[421,6199],{},[421,6201],{"className":6202,"style":666},[467],[421,6204,687],{"className":6205},[670],[421,6207],{"className":6208,"style":666},[467],[421,6210,6212],{"className":6211},[1582,1583],[421,6213,6215],{"className":6214},[446,756],[421,6216,3162],{"className":6217},[446],[421,6219,454],{"className":6220},[453],[421,6222,4782],{"className":6223,"style":4781},[446,447],[421,6225,454],{"className":6226},[453],[421,6228,3023],{"className":6229},[446,447],[421,6231,1378],{"className":6232},[462],[421,6234,588],{"className":6235},[587],[421,6237,6239],{"className":6238},[504],[421,6240,6243],{"className":6241,"style":6242},[508],"height:1.29em;",[421,6244],{},[421,6246],{"className":6247,"style":732},[731],[421,6249,6251],{"className":6250},[608],[421,6252,6254,6373],{"className":6253},[499,500],[421,6255,6257,6370],{"className":6256},[504],[421,6258,6260,6315],{"className":6259,"style":6111},[508],[421,6261,6262,6265],{"style":6114},[421,6263],{"className":6264,"style":625},[516],[421,6266,6268,6275],{"className":6267},[446],[421,6269,6271],{"className":6270},[446,756],[421,6272,6274],{"className":6273},[446],"\u002F\u002F without ",[421,6276,6278,6281],{"className":6277},[446],[421,6279,3339],{"className":6280,"style":3338},[446,447],[421,6282,6284],{"className":6283},[1252],[421,6285,6287,6307],{"className":6286},[499,500],[421,6288,6290,6304],{"className":6289},[504],[421,6291,6293],{"className":6292,"style":3468},[508],[421,6294,6295,6298],{"style":3354},[421,6296],{"className":6297,"style":1269},[516],[421,6299,6301],{"className":6300},[1273,1274,1275,1276],[421,6302,3023],{"className":6303},[446,447,1276],[421,6305,588],{"className":6306},[587],[421,6308,6310],{"className":6309},[504],[421,6311,6313],{"className":6312,"style":1290},[508],[421,6314],{},[421,6316,6317,6320],{"style":6153},[421,6318],{"className":6319,"style":625},[516],[421,6321,6323,6330],{"className":6322},[446],[421,6324,6326],{"className":6325},[446,756],[421,6327,6329],{"className":6328},[446],"\u002F\u002F with ",[421,6331,6333,6336],{"className":6332},[446],[421,6334,3339],{"className":6335,"style":3338},[446,447],[421,6337,6339],{"className":6338},[1252],[421,6340,6342,6362],{"className":6341},[499,500],[421,6343,6345,6359],{"className":6344},[504],[421,6346,6348],{"className":6347,"style":3468},[508],[421,6349,6350,6353],{"style":3354},[421,6351],{"className":6352,"style":1269},[516],[421,6354,6356],{"className":6355},[1273,1274,1275,1276],[421,6357,3023],{"className":6358},[446,447,1276],[421,6360,588],{"className":6361},[587],[421,6363,6365],{"className":6364},[504],[421,6366,6368],{"className":6367,"style":1290},[508],[421,6369],{},[421,6371,588],{"className":6372},[587],[421,6374,6376],{"className":6375},[504],[421,6377,6379],{"className":6378,"style":6242},[508],[421,6380],{},[421,6382],{"className":6383},[462,858],[421,6385,588],{"className":6386},[587],[421,6388,6390],{"className":6389},[504],[421,6391,6394],{"className":6392,"style":6393},[508],"height:2.21em;",[421,6395],{},[421,6397],{"className":6398,"style":732},[731],[421,6400,6402],{"className":6401},[608],[421,6403,6405,6476],{"className":6404},[499,500],[421,6406,6408,6473],{"className":6407},[504],[421,6409,6411,6443],{"className":6410,"style":6051},[508],[421,6412,6413,6416],{"style":6054},[421,6414],{"className":6415,"style":6058},[516],[421,6417,6419,6425,6428,6431,6434,6437,6440],{"className":6418},[446],[421,6420,6422],{"className":6421},[446,756],[421,6423,760],{"className":6424},[446],[421,6426,3023],{"className":6427},[446,447],[421,6429],{"className":6430,"style":468},[467],[421,6432,473],{"className":6433},[472],[421,6435],{"className":6436,"style":468},[467],[421,6438,632],{"className":6439},[446],[421,6441,780],{"className":6442},[779],[421,6444,6445,6448],{"style":6067},[421,6446],{"className":6447,"style":6058},[516],[421,6449,6451,6457,6460,6463,6466,6469],{"className":6450},[446],[421,6452,6454],{"className":6453},[446,756],[421,6455,760],{"className":6456},[446],[421,6458,3023],{"className":6459},[446,447],[421,6461],{"className":6462,"style":468},[467],[421,6464,836],{"className":6465},[472],[421,6467],{"className":6468,"style":468},[467],[421,6470,6472],{"className":6471},[446],"1.",[421,6474,588],{"className":6475},[587],[421,6477,6479],{"className":6478},[504],[421,6480,6482],{"className":6481,"style":6393},[508],[421,6483],{},[421,6485],{"className":6486},[462,858],[381,6488,6489,6490,1680,6493,6545,6546,6594,6595,6598,6599,6651,6652,6704,6705,6836,6837,6873],{},"If we ",[389,6491,6492],{},"exclude",[421,6494,6496],{"className":6495},[428],[421,6497,6499],{"className":6498,"ariaHidden":433},[432],[421,6500,6502,6505],{"className":6501},[437],[421,6503],{"className":6504,"style":1242},[441],[421,6506,6508,6511],{"className":6507},[446],[421,6509,3339],{"className":6510,"style":3338},[446,447],[421,6512,6514],{"className":6513},[1252],[421,6515,6517,6537],{"className":6516},[499,500],[421,6518,6520,6534],{"className":6519},[504],[421,6521,6523],{"className":6522,"style":3468},[508],[421,6524,6525,6528],{"style":3354},[421,6526],{"className":6527,"style":1269},[516],[421,6529,6531],{"className":6530},[1273,1274,1275,1276],[421,6532,3023],{"className":6533},[446,447,1276],[421,6535,588],{"className":6536},[587],[421,6538,6540],{"className":6539},[504],[421,6541,6543],{"className":6542,"style":1290},[508],[421,6544],{},", the best we can do is ",[421,6547,6549],{"className":6548},[428],[421,6550,6552,6582],{"className":6551,"ariaHidden":433},[432],[421,6553,6555,6558,6567,6570,6573,6576,6579],{"className":6554},[437],[421,6556],{"className":6557,"style":442},[441],[421,6559,6561],{"className":6560},[1582,1583],[421,6562,6564],{"className":6563},[446,756],[421,6565,3162],{"className":6566},[446],[421,6568,454],{"className":6569},[453],[421,6571,3023],{"className":6572},[446,447],[421,6574],{"className":6575,"style":666},[467],[421,6577,671],{"className":6578},[670],[421,6580],{"className":6581,"style":666},[467],[421,6583,6585,6588,6591],{"className":6584},[437],[421,6586],{"className":6587,"style":442},[441],[421,6589,403],{"className":6590},[446],[421,6592,463],{"className":6593},[462],". If we ",[389,6596,6597],{},"include","\nit, we collect ",[421,6600,6602],{"className":6601},[428],[421,6603,6605],{"className":6604,"ariaHidden":433},[432],[421,6606,6608,6611],{"className":6607},[437],[421,6609],{"className":6610,"style":3616},[441],[421,6612,6614,6617],{"className":6613},[446],[421,6615,381],{"className":6616},[446,447],[421,6618,6620],{"className":6619},[1252],[421,6621,6623,6643],{"className":6622},[499,500],[421,6624,6626,6640],{"className":6625},[504],[421,6627,6629],{"className":6628,"style":3468},[508],[421,6630,6631,6634],{"style":3530},[421,6632],{"className":6633,"style":1269},[516],[421,6635,6637],{"className":6636},[1273,1274,1275,1276],[421,6638,3023],{"className":6639},[446,447,1276],[421,6641,588],{"className":6642},[587],[421,6644,6646],{"className":6645},[504],[421,6647,6649],{"className":6648,"style":1290},[508],[421,6650],{}," and may no longer use any interval that overlaps ",[421,6653,6655],{"className":6654},[428],[421,6656,6658],{"className":6657,"ariaHidden":433},[432],[421,6659,6661,6664],{"className":6660},[437],[421,6662],{"className":6663,"style":1242},[441],[421,6665,6667,6670],{"className":6666},[446],[421,6668,3339],{"className":6669,"style":3338},[446,447],[421,6671,6673],{"className":6672},[1252],[421,6674,6676,6696],{"className":6675},[499,500],[421,6677,6679,6693],{"className":6678},[504],[421,6680,6682],{"className":6681,"style":3468},[508],[421,6683,6684,6687],{"style":3354},[421,6685],{"className":6686,"style":1269},[516],[421,6688,6690],{"className":6689},[1273,1274,1275,1276],[421,6691,3023],{"className":6692},[446,447,1276],[421,6694,588],{"className":6695},[587],[421,6697,6699],{"className":6698},[504],[421,6700,6702],{"className":6701,"style":1290},[508],[421,6703],{},"; the\nremaining usable intervals are exactly ",[421,6706,6708],{"className":6707},[428],[421,6709,6711],{"className":6710,"ariaHidden":433},[432],[421,6712,6714,6718,6721,6761,6764,6767,6770,6773,6776,6779,6833],{"className":6713},[437],[421,6715],{"className":6716,"style":6717},[441],"height:1.1052em;vertical-align:-0.3552em;",[421,6719,3331],{"className":6720},[453],[421,6722,6724,6727],{"className":6723},[446],[421,6725,3339],{"className":6726,"style":3338},[446,447],[421,6728,6730],{"className":6729},[1252],[421,6731,6733,6753],{"className":6732},[499,500],[421,6734,6736,6750],{"className":6735},[504],[421,6737,6739],{"className":6738,"style":1262},[508],[421,6740,6741,6744],{"style":3354},[421,6742],{"className":6743,"style":1269},[516],[421,6745,6747],{"className":6746},[1273,1274,1275,1276],[421,6748,403],{"className":6749},[446,1276],[421,6751,588],{"className":6752},[587],[421,6754,6756],{"className":6755},[504],[421,6757,6759],{"className":6758,"style":1290},[508],[421,6760],{},[421,6762,780],{"className":6763},[779],[421,6765],{"className":6766,"style":1715},[467],[421,6768,1737],{"className":6769},[487],[421,6771],{"className":6772,"style":1715},[467],[421,6774,780],{"className":6775},[779],[421,6777],{"className":6778,"style":1715},[467],[421,6780,6782,6785],{"className":6781},[446],[421,6783,3339],{"className":6784,"style":3338},[446,447],[421,6786,6788],{"className":6787},[1252],[421,6789,6791,6824],{"className":6790},[499,500],[421,6792,6794,6821],{"className":6793},[504],[421,6795,6797],{"className":6796,"style":3836},[508],[421,6798,6800,6803],{"style":6799},"top:-2.5198em;margin-left:-0.0785em;margin-right:0.05em;",[421,6801],{"className":6802,"style":1269},[516],[421,6804,6806],{"className":6805},[1273,1274,1275,1276],[421,6807,6809,6812,6815,6818],{"className":6808},[446,1276],[421,6810,4782],{"className":6811,"style":4781},[446,447,1276],[421,6813,454],{"className":6814},[453,1276],[421,6816,3023],{"className":6817},[446,447,1276],[421,6819,463],{"className":6820},[462,1276],[421,6822,588],{"className":6823},[587],[421,6825,6827],{"className":6826},[504],[421,6828,6831],{"className":6829,"style":6830},[508],"height:0.3552em;",[421,6832],{},[421,6834,3436],{"className":6835},[462],", so we\nadd ",[421,6838,6840],{"className":6839},[428],[421,6841,6843],{"className":6842,"ariaHidden":433},[432],[421,6844,6846,6849,6858,6861,6864,6867,6870],{"className":6845},[437],[421,6847],{"className":6848,"style":442},[441],[421,6850,6852],{"className":6851},[1582,1583],[421,6853,6855],{"className":6854},[446,756],[421,6856,3162],{"className":6857},[446],[421,6859,454],{"className":6860},[453],[421,6862,4782],{"className":6863,"style":4781},[446,447],[421,6865,454],{"className":6866},[453],[421,6868,3023],{"className":6869},[446,447],[421,6871,1378],{"className":6872},[462]," — optimal substructure in action.",[381,6875,6876,6879,6880,6895,6896,6944,6945,6960,6961,7013,7014,7048,7049,7110,7111,7163,7164,7292,7293,7385],{},[384,6877,6878],{},"Step 4: Correctness (sketch)."," By induction on ",[421,6881,6883],{"className":6882},[428],[421,6884,6886],{"className":6885,"ariaHidden":433},[432],[421,6887,6889,6892],{"className":6888},[437],[421,6890],{"className":6891,"style":4546},[441],[421,6893,3023],{"className":6894},[446,447],". The base case\n",[421,6897,6899],{"className":6898},[428],[421,6900,6902,6935],{"className":6901,"ariaHidden":433},[432],[421,6903,6905,6908,6917,6920,6923,6926,6929,6932],{"className":6904},[437],[421,6906],{"className":6907,"style":442},[441],[421,6909,6911],{"className":6910},[1582,1583],[421,6912,6914],{"className":6913},[446,756],[421,6915,3162],{"className":6916},[446],[421,6918,454],{"className":6919},[453],[421,6921,632],{"className":6922},[446],[421,6924,463],{"className":6925},[462],[421,6927],{"className":6928,"style":468},[467],[421,6930,473],{"className":6931},[472],[421,6933],{"className":6934,"style":468},[467],[421,6936,6938,6941],{"className":6937},[437],[421,6939],{"className":6940,"style":1560},[441],[421,6942,632],{"className":6943},[446]," is immediate. For the step, any optimal schedule on the\nfirst ",[421,6946,6948],{"className":6947},[428],[421,6949,6951],{"className":6950,"ariaHidden":433},[432],[421,6952,6954,6957],{"className":6953},[437],[421,6955],{"className":6956,"style":4546},[441],[421,6958,3023],{"className":6959},[446,447]," intervals either omits ",[421,6962,6964],{"className":6963},[428],[421,6965,6967],{"className":6966,"ariaHidden":433},[432],[421,6968,6970,6973],{"className":6969},[437],[421,6971],{"className":6972,"style":1242},[441],[421,6974,6976,6979],{"className":6975},[446],[421,6977,3339],{"className":6978,"style":3338},[446,447],[421,6980,6982],{"className":6981},[1252],[421,6983,6985,7005],{"className":6984},[499,500],[421,6986,6988,7002],{"className":6987},[504],[421,6989,6991],{"className":6990,"style":3468},[508],[421,6992,6993,6996],{"style":3354},[421,6994],{"className":6995,"style":1269},[516],[421,6997,6999],{"className":6998},[1273,1274,1275,1276],[421,7000,3023],{"className":7001},[446,447,1276],[421,7003,588],{"className":7004},[587],[421,7006,7008],{"className":7007},[504],[421,7009,7011],{"className":7010,"style":1290},[508],[421,7012],{}," (an optimal schedule on the first ",[421,7015,7017],{"className":7016},[428],[421,7018,7020,7039],{"className":7019,"ariaHidden":433},[432],[421,7021,7023,7027,7030,7033,7036],{"className":7022},[437],[421,7024],{"className":7025,"style":7026},[441],"height:0.7429em;vertical-align:-0.0833em;",[421,7028,3023],{"className":7029},[446,447],[421,7031],{"className":7032,"style":666},[467],[421,7034,671],{"className":7035},[670],[421,7037],{"className":7038,"style":666},[467],[421,7040,7042,7045],{"className":7041},[437],[421,7043],{"className":7044,"style":1560},[441],[421,7046,403],{"className":7047},[446],", by\nthe inductive hypothesis ",[421,7050,7052],{"className":7051},[428],[421,7053,7055,7068,7098],{"className":7054,"ariaHidden":433},[432],[421,7056,7058,7062,7065],{"className":7057},[437],[421,7059],{"className":7060,"style":7061},[441],"height:0.3669em;",[421,7063,473],{"className":7064},[472],[421,7066],{"className":7067,"style":468},[467],[421,7069,7071,7074,7083,7086,7089,7092,7095],{"className":7070},[437],[421,7072],{"className":7073,"style":442},[441],[421,7075,7077],{"className":7076},[1582,1583],[421,7078,7080],{"className":7079},[446,756],[421,7081,3162],{"className":7082},[446],[421,7084,454],{"className":7085},[453],[421,7087,3023],{"className":7088},[446,447],[421,7090],{"className":7091,"style":666},[467],[421,7093,671],{"className":7094},[670],[421,7096],{"className":7097,"style":666},[467],[421,7099,7101,7104,7107],{"className":7100},[437],[421,7102],{"className":7103,"style":442},[441],[421,7105,403],{"className":7106},[446],[421,7108,463],{"className":7109},[462],") or contains ",[421,7112,7114],{"className":7113},[428],[421,7115,7117],{"className":7116,"ariaHidden":433},[432],[421,7118,7120,7123],{"className":7119},[437],[421,7121],{"className":7122,"style":1242},[441],[421,7124,7126,7129],{"className":7125},[446],[421,7127,3339],{"className":7128,"style":3338},[446,447],[421,7130,7132],{"className":7131},[1252],[421,7133,7135,7155],{"className":7134},[499,500],[421,7136,7138,7152],{"className":7137},[504],[421,7139,7141],{"className":7140,"style":3468},[508],[421,7142,7143,7146],{"style":3354},[421,7144],{"className":7145,"style":1269},[516],[421,7147,7149],{"className":7148},[1273,1274,1275,1276],[421,7150,3023],{"className":7151},[446,447,1276],[421,7153,588],{"className":7154},[587],[421,7156,7158],{"className":7157},[504],[421,7159,7161],{"className":7160,"style":1290},[508],[421,7162],{}," (then the rest\nis an optimal schedule on ",[421,7165,7167],{"className":7166},[428],[421,7168,7170],{"className":7169,"ariaHidden":433},[432],[421,7171,7173,7176,7179,7219,7222,7225,7228,7231,7234,7237,7289],{"className":7172},[437],[421,7174],{"className":7175,"style":6717},[441],[421,7177,3331],{"className":7178},[453],[421,7180,7182,7185],{"className":7181},[446],[421,7183,3339],{"className":7184,"style":3338},[446,447],[421,7186,7188],{"className":7187},[1252],[421,7189,7191,7211],{"className":7190},[499,500],[421,7192,7194,7208],{"className":7193},[504],[421,7195,7197],{"className":7196,"style":1262},[508],[421,7198,7199,7202],{"style":3354},[421,7200],{"className":7201,"style":1269},[516],[421,7203,7205],{"className":7204},[1273,1274,1275,1276],[421,7206,403],{"className":7207},[446,1276],[421,7209,588],{"className":7210},[587],[421,7212,7214],{"className":7213},[504],[421,7215,7217],{"className":7216,"style":1290},[508],[421,7218],{},[421,7220,780],{"className":7221},[779],[421,7223],{"className":7224,"style":1715},[467],[421,7226,1737],{"className":7227},[487],[421,7229],{"className":7230,"style":1715},[467],[421,7232,780],{"className":7233},[779],[421,7235],{"className":7236,"style":1715},[467],[421,7238,7240,7243],{"className":7239},[446],[421,7241,3339],{"className":7242,"style":3338},[446,447],[421,7244,7246],{"className":7245},[1252],[421,7247,7249,7281],{"className":7248},[499,500],[421,7250,7252,7278],{"className":7251},[504],[421,7253,7255],{"className":7254,"style":3836},[508],[421,7256,7257,7260],{"style":6799},[421,7258],{"className":7259,"style":1269},[516],[421,7261,7263],{"className":7262},[1273,1274,1275,1276],[421,7264,7266,7269,7272,7275],{"className":7265},[446,1276],[421,7267,4782],{"className":7268,"style":4781},[446,447,1276],[421,7270,454],{"className":7271},[453,1276],[421,7273,3023],{"className":7274},[446,447,1276],[421,7276,463],{"className":7277},[462,1276],[421,7279,588],{"className":7280},[587],[421,7282,7284],{"className":7283},[504],[421,7285,7287],{"className":7286,"style":6830},[508],[421,7288],{},[421,7290,3436],{"className":7291},[462],", contributing\n",[421,7294,7296],{"className":7295},[428],[421,7297,7299,7355],{"className":7298,"ariaHidden":433},[432],[421,7300,7302,7306,7346,7349,7352],{"className":7301},[437],[421,7303],{"className":7304,"style":7305},[441],"height:0.7778em;vertical-align:-0.1944em;",[421,7307,7309,7312],{"className":7308},[446],[421,7310,381],{"className":7311},[446,447],[421,7313,7315],{"className":7314},[1252],[421,7316,7318,7338],{"className":7317},[499,500],[421,7319,7321,7335],{"className":7320},[504],[421,7322,7324],{"className":7323,"style":3468},[508],[421,7325,7326,7329],{"style":3530},[421,7327],{"className":7328,"style":1269},[516],[421,7330,7332],{"className":7331},[1273,1274,1275,1276],[421,7333,3023],{"className":7334},[446,447,1276],[421,7336,588],{"className":7337},[587],[421,7339,7341],{"className":7340},[504],[421,7342,7344],{"className":7343,"style":1290},[508],[421,7345],{},[421,7347],{"className":7348,"style":666},[467],[421,7350,687],{"className":7351},[670],[421,7353],{"className":7354,"style":666},[467],[421,7356,7358,7361,7370,7373,7376,7379,7382],{"className":7357},[437],[421,7359],{"className":7360,"style":442},[441],[421,7362,7364],{"className":7363},[1582,1583],[421,7365,7367],{"className":7366},[446,756],[421,7368,3162],{"className":7369},[446],[421,7371,454],{"className":7372},[453],[421,7374,4782],{"className":7375,"style":4781},[446,447],[421,7377,454],{"className":7378},[453],[421,7380,3023],{"className":7381},[446,447],[421,7383,1378],{"className":7384},[462],"). Taking the max of the two cases is exactly the\nequation.",[381,7387,7388,7391,7392,7407,7408,7456,7457,7494],{},[384,7389,7390],{},"Step 5: Pseudocode."," Fill the table in increasing ",[421,7393,7395],{"className":7394},[428],[421,7396,7398],{"className":7397,"ariaHidden":433},[432],[421,7399,7401,7404],{"className":7400},[437],[421,7402],{"className":7403,"style":4546},[441],[421,7405,3023],{"className":7406},[446,447],", so both\n",[421,7409,7411],{"className":7410},[428],[421,7412,7414,7444],{"className":7413,"ariaHidden":433},[432],[421,7415,7417,7420,7429,7432,7435,7438,7441],{"className":7416},[437],[421,7418],{"className":7419,"style":442},[441],[421,7421,7423],{"className":7422},[1582,1583],[421,7424,7426],{"className":7425},[446,756],[421,7427,3162],{"className":7428},[446],[421,7430,2915],{"className":7431},[453],[421,7433,3023],{"className":7434},[446,447],[421,7436],{"className":7437,"style":666},[467],[421,7439,671],{"className":7440},[670],[421,7442],{"className":7443,"style":666},[467],[421,7445,7447,7450,7453],{"className":7446},[437],[421,7448],{"className":7449,"style":442},[441],[421,7451,403],{"className":7452},[446],[421,7454,2923],{"className":7455},[462]," and ",[421,7458,7460],{"className":7459},[428],[421,7461,7463],{"className":7462,"ariaHidden":433},[432],[421,7464,7466,7469,7478,7481,7484,7487,7490],{"className":7465},[437],[421,7467],{"className":7468,"style":442},[441],[421,7470,7472],{"className":7471},[1582,1583],[421,7473,7475],{"className":7474},[446,756],[421,7476,3162],{"className":7477},[446],[421,7479,2915],{"className":7480},[453],[421,7482,4782],{"className":7483,"style":4781},[446,447],[421,7485,454],{"className":7486},[453],[421,7488,3023],{"className":7489},[446,447],[421,7491,7493],{"className":7492},[462],")]"," are ready when needed.",[863,7496,7498],{"className":865,"code":7497,"language":867,"meta":376,"style":376},"caption: $\\textsc{Iter-IS}(I_1, \\dots, I_n)$ — max-profit interval scheduling\nnumber: 4\nsort intervals by increasing finish time $f_i$ \u002F\u002F $O(n \\log n)$\n$\\textsc{Opt}[0] \\gets 0$\nfor $i \\gets 1$ to $n$ do\n  $k \\gets q(i)$\n  $\\textsc{Opt}[i] \\gets \\max\\bigl(\\textsc{Opt}[i-1],\\ p_i + \\textsc{Opt}[k]\\bigr)$ \u002F\u002F $O(1)$ per iteration\nreturn $\\textsc{Opt}[n]$\n",[869,7499,7500,7505,7510,7515,7520,7525,7530,7535],{"__ignoreMap":376},[421,7501,7502],{"class":873,"line":6},[421,7503,7504],{},"caption: $\\textsc{Iter-IS}(I_1, \\dots, I_n)$ — max-profit interval scheduling\n",[421,7506,7507],{"class":873,"line":18},[421,7508,7509],{},"number: 4\n",[421,7511,7512],{"class":873,"line":24},[421,7513,7514],{},"sort intervals by increasing finish time $f_i$ \u002F\u002F $O(n \\log n)$\n",[421,7516,7517],{"class":873,"line":73},[421,7518,7519],{},"$\\textsc{Opt}[0] \\gets 0$\n",[421,7521,7522],{"class":873,"line":102},[421,7523,7524],{},"for $i \\gets 1$ to $n$ do\n",[421,7526,7527],{"class":873,"line":108},[421,7528,7529],{},"  $k \\gets q(i)$\n",[421,7531,7532],{"class":873,"line":116},[421,7533,7534],{},"  $\\textsc{Opt}[i] \\gets \\max\\bigl(\\textsc{Opt}[i-1],\\ p_i + \\textsc{Opt}[k]\\bigr)$ \u002F\u002F $O(1)$ per iteration\n",[421,7536,7537],{"class":873,"line":196},[421,7538,7539],{},"return $\\textsc{Opt}[n]$\n",[381,7541,7542,7545,7546,7589,7590,7606,7607,7631,7632,1680,7635,7659,7660,7684,7685,7718,7719,7734,7735,7759],{},[384,7543,7544],{},"Step 8: Running time."," The sort costs ",[421,7547,7549],{"className":7548},[428],[421,7550,7552],{"className":7551,"ariaHidden":433},[432],[421,7553,7555,7558,7563,7566,7569,7572,7580,7583,7586],{"className":7554},[437],[421,7556],{"className":7557,"style":442},[441],[421,7559,7562],{"className":7560,"style":7561},[446,447],"margin-right:0.0278em;","O",[421,7564,454],{"className":7565},[453],[421,7567,458],{"className":7568},[446,447],[421,7570],{"className":7571,"style":1715},[467],[421,7573,7575],{"className":7574},[4811],[421,7576,7579],{"className":7577,"style":7578},[446,4815],"margin-right:0.0139em;","log",[421,7581],{"className":7582,"style":1715},[467],[421,7584,458],{"className":7585},[446,447],[421,7587,463],{"className":7588},[462],". Each of the ",[421,7591,7593],{"className":7592},[428],[421,7594,7596],{"className":7595,"ariaHidden":433},[432],[421,7597,7599,7603],{"className":7598},[437],[421,7600],{"className":7601,"style":7602},[441],"height:0.4306em;",[421,7604,458],{"className":7605},[446,447]," table\nentries does ",[421,7608,7610],{"className":7609},[428],[421,7611,7613],{"className":7612,"ariaHidden":433},[432],[421,7614,7616,7619,7622,7625,7628],{"className":7615},[437],[421,7617],{"className":7618,"style":442},[441],[421,7620,7562],{"className":7621,"style":7561},[446,447],[421,7623,454],{"className":7624},[453],[421,7626,403],{"className":7627},[446],[421,7629,463],{"className":7630},[462]," work ",[389,7633,7634],{},"given",[421,7636,7638],{"className":7637},[428],[421,7639,7641],{"className":7640,"ariaHidden":433},[432],[421,7642,7644,7647,7650,7653,7656],{"className":7643},[437],[421,7645],{"className":7646,"style":442},[441],[421,7648,4782],{"className":7649,"style":4781},[446,447],[421,7651,454],{"className":7652},[453],[421,7654,3023],{"className":7655},[446,447],[421,7657,463],{"className":7658},[462],". The values ",[421,7661,7663],{"className":7662},[428],[421,7664,7666],{"className":7665,"ariaHidden":433},[432],[421,7667,7669,7672,7675,7678,7681],{"className":7668},[437],[421,7670],{"className":7671,"style":442},[441],[421,7673,4782],{"className":7674,"style":4781},[446,447],[421,7676,454],{"className":7677},[453],[421,7679,3023],{"className":7680},[446,447],[421,7682,463],{"className":7683},[462]," themselves can be found\nby binary search (",[421,7686,7688],{"className":7687},[428],[421,7689,7691],{"className":7690,"ariaHidden":433},[432],[421,7692,7694,7697,7700,7703,7709,7712,7715],{"className":7693},[437],[421,7695],{"className":7696,"style":442},[441],[421,7698,7562],{"className":7699,"style":7561},[446,447],[421,7701,454],{"className":7702},[453],[421,7704,7706],{"className":7705},[4811],[421,7707,7579],{"className":7708,"style":7578},[446,4815],[421,7710],{"className":7711,"style":1715},[467],[421,7713,458],{"className":7714},[446,447],[421,7716,463],{"className":7717},[462]," each) or, since they are monotone in ",[421,7720,7722],{"className":7721},[428],[421,7723,7725],{"className":7724,"ariaHidden":433},[432],[421,7726,7728,7731],{"className":7727},[437],[421,7729],{"className":7730,"style":4546},[441],[421,7732,3023],{"className":7733},[446,447],", by a single\nlinear scan that advances across all iterations in ",[421,7736,7738],{"className":7737},[428],[421,7739,7741],{"className":7740,"ariaHidden":433},[432],[421,7742,7744,7747,7750,7753,7756],{"className":7743},[437],[421,7745],{"className":7746,"style":442},[441],[421,7748,7562],{"className":7749,"style":7561},[446,447],[421,7751,454],{"className":7752},[453],[421,7754,458],{"className":7755},[446,447],[421,7757,463],{"className":7758},[462]," total. Either way the\nsort dominates, for a worst-case running time of",[421,7761,7763],{"className":7762},[424],[421,7764,7766],{"className":7765},[428],[421,7767,7769],{"className":7768,"ariaHidden":433},[432],[421,7770,7772,7775,7778,7781,7784,7787,7793,7796,7799,7802],{"className":7771},[437],[421,7773],{"className":7774,"style":442},[441],[421,7776,7562],{"className":7777,"style":7561},[446,447],[421,7779,454],{"className":7780},[453],[421,7782,458],{"className":7783},[446,447],[421,7785],{"className":7786,"style":1715},[467],[421,7788,7790],{"className":7789},[4811],[421,7791,7579],{"className":7792,"style":7578},[446,4815],[421,7794],{"className":7795,"style":1715},[467],[421,7797,458],{"className":7798},[446,447],[421,7800,463],{"className":7801},[462],[421,7803,392],{"className":7804},[446],[381,7806,7807,7808,7811,7812,7842,7843,7456,7891,7927],{},"This is the canonical ",[4782,7809,7810],{},"include-or-exclude"," DP, and its dependency structure makes\nthe overlap concrete: entry ",[421,7813,7815],{"className":7814},[428],[421,7816,7818],{"className":7817,"ariaHidden":433},[432],[421,7819,7821,7824,7833,7836,7839],{"className":7820},[437],[421,7822],{"className":7823,"style":442},[441],[421,7825,7827],{"className":7826},[1582,1583],[421,7828,7830],{"className":7829},[446,756],[421,7831,3162],{"className":7832},[446],[421,7834,454],{"className":7835},[453],[421,7837,3023],{"className":7838},[446,447],[421,7840,463],{"className":7841},[462]," points back to its two predecessors,\n",[421,7844,7846],{"className":7845},[428],[421,7847,7849,7879],{"className":7848,"ariaHidden":433},[432],[421,7850,7852,7855,7864,7867,7870,7873,7876],{"className":7851},[437],[421,7853],{"className":7854,"style":442},[441],[421,7856,7858],{"className":7857},[1582,1583],[421,7859,7861],{"className":7860},[446,756],[421,7862,3162],{"className":7863},[446],[421,7865,454],{"className":7866},[453],[421,7868,3023],{"className":7869},[446,447],[421,7871],{"className":7872,"style":666},[467],[421,7874,671],{"className":7875},[670],[421,7877],{"className":7878,"style":666},[467],[421,7880,7882,7885,7888],{"className":7881},[437],[421,7883],{"className":7884,"style":442},[441],[421,7886,403],{"className":7887},[446],[421,7889,463],{"className":7890},[462],[421,7892,7894],{"className":7893},[428],[421,7895,7897],{"className":7896,"ariaHidden":433},[432],[421,7898,7900,7903,7912,7915,7918,7921,7924],{"className":7899},[437],[421,7901],{"className":7902,"style":442},[441],[421,7904,7906],{"className":7905},[1582,1583],[421,7907,7909],{"className":7908},[446,756],[421,7910,3162],{"className":7911},[446],[421,7913,454],{"className":7914},[453],[421,7916,4782],{"className":7917,"style":4781},[446,447],[421,7919,454],{"className":7920},[453],[421,7922,3023],{"className":7923},[446,447],[421,7925,1378],{"className":7926},[462],", and those arrows cross and reconverge\non shared subproblems, the same overlap that doomed naive Fibonacci.",[927,7929,7931,8049],{"className":7930},[930,931],[536,7932,7936],{"xmlns":538,"width":7933,"height":7934,"viewBox":7935},"171.922","242.427","-75 -75 128.941 181.820",[938,7937,7938,7941,7947,7950,7957,7960,7967,7970,7977,7980,7987,7990,7997,8000,8004,8007,8011,8014,8017,8020,8024,8027,8030,8033,8036,8039,8043,8046],{"stroke":940,"style":941},[545,7939],{"fill":944,"d":7940},"M-12.525-60.689c0-6.286-5.095-11.381-11.38-11.381s-11.382 5.095-11.382 11.381 5.096 11.381 11.381 11.381 11.381-5.095 11.381-11.38Zm-11.38 0",[938,7942,7943],{"transform":2638},[545,7944],{"d":7945,"fill":940,"stroke":940,"className":7946,"style":1965},"M-23.080-61.695Q-22.939-61.282-22.579-61.030Q-22.218-60.777-21.783-60.777Q-21.331-60.777-21.065-61.030Q-20.799-61.282-20.696-61.667Q-20.593-62.051-20.593-62.508Q-20.593-64.209-21.502-64.209Q-21.823-64.209-22.052-64.115Q-22.280-64.020-22.410-63.901Q-22.539-63.783-22.651-63.644Q-22.763-63.506-22.799-63.497L-22.882-63.497Q-22.926-63.497-22.957-63.528Q-22.988-63.559-22.988-63.607L-22.988-66.604Q-22.988-66.635-22.952-66.659Q-22.917-66.683-22.891-66.683L-22.851-66.683Q-22.218-66.393-21.546-66.393Q-20.874-66.393-20.232-66.683L-20.206-66.683Q-20.175-66.683-20.142-66.661Q-20.109-66.639-20.109-66.604L-20.109-66.503Q-20.109-66.499-20.118-66.481Q-20.127-66.463-20.127-66.459Q-20.443-66.064-20.913-65.842Q-21.384-65.620-21.880-65.620Q-22.289-65.620-22.671-65.730L-22.671-64.011Q-22.214-64.468-21.502-64.468Q-20.992-64.468-20.593-64.187Q-20.193-63.906-19.971-63.451Q-19.749-62.996-19.749-62.491Q-19.749-61.941-20.028-61.482Q-20.307-61.023-20.773-60.757Q-21.239-60.491-21.783-60.491Q-22.223-60.491-22.607-60.718Q-22.992-60.944-23.220-61.324Q-23.449-61.704-23.449-62.148Q-23.449-62.341-23.317-62.473Q-23.185-62.605-22.988-62.605Q-22.856-62.605-22.752-62.546Q-22.649-62.486-22.590-62.383Q-22.531-62.280-22.531-62.148Q-22.531-61.950-22.658-61.818Q-22.785-61.687-22.988-61.687Q-23.049-61.687-23.080-61.695",[955],[545,7948],{"fill":944,"d":7949},"M-45.975-15.858c0-6.286-5.095-11.381-11.38-11.381s-11.382 5.095-11.382 11.381S-63.64-4.477-57.356-4.477s11.381-5.095 11.381-11.381Zm-11.38 0",[938,7951,7953],{"transform":7952},"translate(-35.762 47.73)",[545,7954],{"d":7955,"fill":940,"stroke":940,"className":7956,"style":1965},"M-21.208-62.166L-23.647-62.166L-23.647-62.482L-20.821-66.630Q-20.777-66.683-20.711-66.683L-20.557-66.683Q-20.518-66.683-20.485-66.650Q-20.452-66.617-20.452-66.573L-20.452-62.482L-19.551-62.482L-19.551-62.166L-20.452-62.166L-20.452-61.300Q-20.452-61.005-19.551-61.005L-19.551-60.689L-22.104-60.689L-22.104-61.005Q-21.744-61.005-21.476-61.060Q-21.208-61.115-21.208-61.300L-21.208-62.166M-21.151-65.655L-23.313-62.482L-21.151-62.482",[955],[545,7958],{"fill":944,"d":7959},"M-45.975 47.138c0-6.286-5.095-11.381-11.38-11.381s-11.382 5.095-11.382 11.381 5.096 11.381 11.381 11.381 11.381-5.095 11.381-11.381Zm-11.38 0",[938,7961,7963],{"transform":7962},"translate(-35.762 110.727)",[545,7964],{"d":7965,"fill":940,"stroke":940,"className":7966,"style":1965},"M-23.005-61.410L-23.049-61.410Q-22.847-61.093-22.460-60.935Q-22.073-60.777-21.647-60.777Q-21.111-60.777-20.872-61.212Q-20.632-61.647-20.632-62.227Q-20.632-62.807-20.878-63.247Q-21.124-63.686-21.656-63.686L-22.276-63.686Q-22.302-63.686-22.335-63.715Q-22.368-63.743-22.368-63.765L-22.368-63.866Q-22.368-63.897-22.339-63.921Q-22.311-63.945-22.276-63.945L-21.757-63.985Q-21.291-63.985-21.045-64.457Q-20.799-64.930-20.799-65.448Q-20.799-65.875-21.012-66.149Q-21.225-66.424-21.647-66.424Q-21.990-66.424-22.315-66.294Q-22.640-66.165-22.825-65.910L-22.799-65.910Q-22.596-65.910-22.460-65.769Q-22.324-65.628-22.324-65.431Q-22.324-65.233-22.458-65.099Q-22.592-64.965-22.790-64.965Q-22.992-64.965-23.130-65.099Q-23.269-65.233-23.269-65.431Q-23.269-66.020-22.766-66.351Q-22.262-66.683-21.647-66.683Q-21.269-66.683-20.867-66.543Q-20.465-66.402-20.197-66.123Q-19.929-65.844-19.929-65.448Q-19.929-64.899-20.283-64.462Q-20.636-64.024-21.177-63.840Q-20.786-63.761-20.441-63.537Q-20.096-63.313-19.885-62.972Q-19.674-62.631-19.674-62.236Q-19.674-61.854-19.837-61.531Q-19.999-61.208-20.291-60.972Q-20.584-60.737-20.931-60.614Q-21.278-60.491-21.647-60.491Q-22.095-60.491-22.526-60.652Q-22.957-60.812-23.238-61.139Q-23.519-61.467-23.519-61.924Q-23.519-62.139-23.372-62.282Q-23.225-62.425-23.005-62.425Q-22.794-62.425-22.649-62.280Q-22.504-62.135-22.504-61.924Q-22.504-61.713-22.651-61.561Q-22.799-61.410-23.005-61.410",[955],[545,7968],{"fill":944,"d":7969},"M17.022 47.138c0-6.286-5.096-11.381-11.382-11.381S-5.74 40.852-5.74 47.138-.646 58.519 5.64 58.519s11.382-5.095 11.382-11.381Zm-11.382 0",[938,7971,7973],{"transform":7972},"translate(27.234 110.727)",[545,7974],{"d":7975,"fill":940,"stroke":940,"className":7976,"style":1965},"M-19.999-60.689L-23.449-60.689L-23.449-60.922Q-23.449-60.935-23.418-60.966L-21.964-62.543Q-21.498-63.040-21.245-63.345Q-20.992-63.651-20.801-64.062Q-20.610-64.473-20.610-64.912Q-20.610-65.501-20.933-65.934Q-21.256-66.367-21.836-66.367Q-22.100-66.367-22.346-66.257Q-22.592-66.147-22.768-65.960Q-22.944-65.773-23.040-65.523L-22.961-65.523Q-22.759-65.523-22.616-65.387Q-22.473-65.251-22.473-65.035Q-22.473-64.829-22.616-64.690Q-22.759-64.552-22.961-64.552Q-23.163-64.552-23.306-64.695Q-23.449-64.837-23.449-65.035Q-23.449-65.497-23.212-65.870Q-22.974-66.244-22.574-66.463Q-22.175-66.683-21.726-66.683Q-21.203-66.683-20.749-66.468Q-20.294-66.252-20.021-65.853Q-19.749-65.453-19.749-64.912Q-19.749-64.517-19.920-64.163Q-20.092-63.809-20.357-63.530Q-20.623-63.251-21.074-62.866Q-21.524-62.482-21.603-62.407L-22.627-61.445L-21.810-61.445Q-21.159-61.445-20.722-61.456Q-20.285-61.467-20.254-61.489Q-20.184-61.572-20.129-61.812Q-20.074-62.051-20.034-62.319L-19.749-62.319",[955],[545,7978],{"fill":944,"d":7979},"M-12.525 91.969c0-6.286-5.095-11.381-11.38-11.381s-11.382 5.095-11.382 11.38c0 6.287 5.096 11.382 11.381 11.382s11.381-5.095 11.381-11.381Zm-11.38 0",[938,7981,7983],{"transform":7982},"translate(-2.312 155.558)",[545,7984],{"d":7985,"fill":940,"stroke":940,"className":7986,"style":1965},"M-19.999-60.689L-23.031-60.689L-23.031-61.005Q-21.880-61.005-21.880-61.300L-21.880-66.024Q-22.368-65.791-23.089-65.791L-23.089-66.107Q-21.959-66.107-21.397-66.683L-21.252-66.683Q-21.217-66.683-21.184-66.650Q-21.151-66.617-21.151-66.582L-21.151-61.300Q-21.151-61.005-19.999-61.005",[955],[545,7988],{"fill":944,"d":7989},"M50.471 91.969c0-6.286-5.095-11.381-11.38-11.381s-11.382 5.095-11.382 11.38c0 6.287 5.096 11.382 11.381 11.382s11.381-5.095 11.381-11.381Zm-11.38 0",[938,7991,7993],{"transform":7992},"translate(60.684 155.558)",[545,7994],{"d":7995,"fill":940,"stroke":940,"className":7996,"style":1965},"M-21.594-60.491Q-22.719-60.491-23.133-61.388Q-23.546-62.284-23.546-63.559Q-23.546-64.332-23.396-65.031Q-23.247-65.730-22.812-66.206Q-22.377-66.683-21.594-66.683Q-20.817-66.683-20.382-66.204Q-19.947-65.725-19.797-65.029Q-19.648-64.332-19.648-63.559Q-19.648-62.280-20.061-61.386Q-20.474-60.491-21.594-60.491M-21.594-60.751Q-21.076-60.751-20.825-61.262Q-20.575-61.774-20.518-62.385Q-20.461-62.996-20.461-63.704Q-20.461-64.389-20.518-64.949Q-20.575-65.510-20.828-65.967Q-21.080-66.424-21.594-66.424Q-21.999-66.424-22.236-66.147Q-22.473-65.870-22.581-65.429Q-22.689-64.987-22.713-64.594Q-22.737-64.200-22.737-63.704Q-22.737-63.198-22.713-62.770Q-22.689-62.341-22.581-61.858Q-22.473-61.375-22.234-61.063Q-21.994-60.751-21.594-60.751",[955],[545,7998],{"fill":944,"d":7999},"M-27.624-49.721c-4.266 12.582-9.43 19.504-17.766 25.4",[545,8001],{"d":8002,"style":8003},"m-47.436-22.874 3.706-.967-1.742-.422.182-1.784Z","stroke-width:.39998",[545,8005],{"fill":944,"d":8006},"M-17.544-51.012C1.756-21.658 7.821.478 6.324 32.498",[545,8008],{"d":8009,"style":8010},"m6.207 35.001 1.517-3.517-1.404 1.114-1.295-1.24Z","stroke-width:.399984",[545,8012],{"fill":944,"d":8013},"M-53.777-4.844c4.937 15.194 4.937 25.773.95 38.043",[545,8015],{"d":8016},"m-53.601 35.582 2.392-2.992-1.649.704-.92-1.538Z",[545,8018],{"fill":944,"d":8019},"M-50.675-6.4C-30.193 22.6-23.277 44.89-23.71 77.315",[545,8021],{"d":8022,"style":8023},"m-23.744 79.82 1.399-3.566-1.367 1.16-1.334-1.196Z","stroke-width:.399988",[545,8025],{"fill":944,"d":8026},"M-46.341 43.56c15.194-4.938 25.773-4.938 38.042-.95",[545,8028],{"d":8029},"m-5.915 43.383-2.992-2.392.703 1.649-1.538.92Z",[545,8031],{"fill":944,"d":8032},"M-45.86 48.535c32.653 3.97 52.388 13.143 74.22 33.452",[545,8034],{"d":8035,"style":8010},"m30.194 83.693-1.704-3.43-.057 1.792-1.783.186Z",[545,8037],{"fill":944,"d":8038},"M2.568 58.303c-3.285 11.938-7.75 18.712-15.022 24.52",[545,8040],{"d":8041,"style":8042},"m-14.412 84.387 3.644-1.182-1.764-.32.078-1.79Z","stroke-width:.399972",[545,8044],{"fill":944,"d":8045},"M-12.892 88.39c15.195-4.937 25.774-4.937 38.043-.95",[545,8047],{"d":8048},"m27.534 88.214-2.991-2.392.703 1.649-1.538.92Z",[1197,8050,8052],{"className":8051},[1200],"Dependency graph of interval-scheduling subproblems sharing overlapping entries.",[381,8054,8055,8056,2204,8086,2204,8116,8146],{},"Several nodes (",[421,8057,8059],{"className":8058},[428],[421,8060,8062],{"className":8061,"ariaHidden":433},[432],[421,8063,8065,8068,8077,8080,8083],{"className":8064},[437],[421,8066],{"className":8067,"style":442},[441],[421,8069,8071],{"className":8070},[1582,1583],[421,8072,8074],{"className":8073},[446,756],[421,8075,3162],{"className":8076},[446],[421,8078,454],{"className":8079},[453],[421,8081,712],{"className":8082},[446],[421,8084,463],{"className":8085},[462],[421,8087,8089],{"className":8088},[428],[421,8090,8092],{"className":8091,"ariaHidden":433},[432],[421,8093,8095,8098,8107,8110,8113],{"className":8094},[437],[421,8096],{"className":8097,"style":442},[441],[421,8099,8101],{"className":8100},[1582,1583],[421,8102,8104],{"className":8103},[446,756],[421,8105,3162],{"className":8106},[446],[421,8108,454],{"className":8109},[453],[421,8111,403],{"className":8112},[446],[421,8114,463],{"className":8115},[462],[421,8117,8119],{"className":8118},[428],[421,8120,8122],{"className":8121,"ariaHidden":433},[432],[421,8123,8125,8128,8137,8140,8143],{"className":8124},[437],[421,8126],{"className":8127,"style":442},[441],[421,8129,8131],{"className":8130},[1582,1583],[421,8132,8134],{"className":8133},[446,756],[421,8135,3162],{"className":8136},[446],[421,8138,454],{"className":8139},[453],[421,8141,632],{"className":8142},[446],[421,8144,463],{"className":8145},[462],") are\npointed to more than once: those are the overlapping subproblems the table solves\njust once.",[381,8148,8149,8152,8153,8156,8157,8172,8173,8224,8225,8277,8278,392],{},[384,8150,8151],{},"Step 6: Back to the original goal."," To recover the ",[389,8154,8155],{},"actual"," set, record at each\n",[421,8158,8160],{"className":8159},[428],[421,8161,8163],{"className":8162,"ariaHidden":433},[432],[421,8164,8166,8169],{"className":8165},[437],[421,8167],{"className":8168,"style":4546},[441],[421,8170,3023],{"className":8171},[446,447]," which branch won. In the pseudocode below, ",[421,8174,8176],{"className":8175},[428],[421,8177,8179,8211],{"className":8178,"ariaHidden":433},[432],[421,8180,8182,8185,8193,8196,8199,8202,8205,8208],{"className":8181},[437],[421,8183],{"className":8184,"style":442},[441],[421,8186,8188],{"className":8187},[446,756],[421,8189,8192],{"className":8190},[446,8191],"textit","chosen",[421,8194,2915],{"className":8195},[453],[421,8197,3023],{"className":8198},[446,447],[421,8200,2923],{"className":8201},[462],[421,8203],{"className":8204,"style":468},[467],[421,8206,473],{"className":8207},[472],[421,8209],{"className":8210,"style":468},[467],[421,8212,8214,8218],{"className":8213},[437],[421,8215],{"className":8216,"style":8217},[441],"height:0.6151em;",[421,8219,8221],{"className":8220},[446,756],[421,8222,433],{"className":8223},[446],"\nmeans ",[421,8226,8228],{"className":8227},[428],[421,8229,8231],{"className":8230,"ariaHidden":433},[432],[421,8232,8234,8237],{"className":8233},[437],[421,8235],{"className":8236,"style":1242},[441],[421,8238,8240,8243],{"className":8239},[446],[421,8241,3339],{"className":8242,"style":3338},[446,447],[421,8244,8246],{"className":8245},[1252],[421,8247,8249,8269],{"className":8248},[499,500],[421,8250,8252,8266],{"className":8251},[504],[421,8253,8255],{"className":8254,"style":3468},[508],[421,8256,8257,8260],{"style":3354},[421,8258],{"className":8259,"style":1269},[516],[421,8261,8263],{"className":8262},[1273,1274,1275,1276],[421,8264,3023],{"className":8265},[446,447,1276],[421,8267,588],{"className":8268},[587],[421,8270,8272],{"className":8271},[504],[421,8273,8275],{"className":8274,"style":1290},[508],[421,8276],{}," is in the optimal solution for the prefix ",[421,8279,8281],{"className":8280},[428],[421,8282,8284],{"className":8283,"ariaHidden":433},[432],[421,8285,8287,8290,8293,8333,8336,8339,8342,8345,8348,8351,8391],{"className":8286},[437],[421,8288],{"className":8289,"style":442},[441],[421,8291,3331],{"className":8292},[453],[421,8294,8296,8299],{"className":8295},[446],[421,8297,3339],{"className":8298,"style":3338},[446,447],[421,8300,8302],{"className":8301},[1252],[421,8303,8305,8325],{"className":8304},[499,500],[421,8306,8308,8322],{"className":8307},[504],[421,8309,8311],{"className":8310,"style":1262},[508],[421,8312,8313,8316],{"style":3354},[421,8314],{"className":8315,"style":1269},[516],[421,8317,8319],{"className":8318},[1273,1274,1275,1276],[421,8320,403],{"className":8321},[446,1276],[421,8323,588],{"className":8324},[587],[421,8326,8328],{"className":8327},[504],[421,8329,8331],{"className":8330,"style":1290},[508],[421,8332],{},[421,8334,780],{"className":8335},[779],[421,8337],{"className":8338,"style":1715},[467],[421,8340,1737],{"className":8341},[487],[421,8343],{"className":8344,"style":1715},[467],[421,8346,780],{"className":8347},[779],[421,8349],{"className":8350,"style":1715},[467],[421,8352,8354,8357],{"className":8353},[446],[421,8355,3339],{"className":8356,"style":3338},[446,447],[421,8358,8360],{"className":8359},[1252],[421,8361,8363,8383],{"className":8362},[499,500],[421,8364,8366,8380],{"className":8365},[504],[421,8367,8369],{"className":8368,"style":3468},[508],[421,8370,8371,8374],{"style":3354},[421,8372],{"className":8373,"style":1269},[516],[421,8375,8377],{"className":8376},[1273,1274,1275,1276],[421,8378,3023],{"className":8379},[446,447,1276],[421,8381,588],{"className":8382},[587],[421,8384,8386],{"className":8385},[504],[421,8387,8389],{"className":8388,"style":1290},[508],[421,8390],{},[421,8392,3436],{"className":8393},[462],[863,8395,8397],{"className":865,"code":8396,"language":867,"meta":376,"style":376},"caption: $\\textsc{Iter-IS}^{\\prime}(I_1, \\dots, I_n)$ — also reconstruct the set\nnumber: 5\nsort intervals by increasing finish time $f_i$\n$\\textsc{Opt}[0] \\gets 0$\nallocate boolean array $\\textit{chosen}[1..n]$\nfor $i \\gets 1$ to $n$ do\n  $k \\gets q(i)$\n  if $\\textsc{Opt}[i-1] \\ge p_i + \\textsc{Opt}[k]$ then\n    $\\textit{chosen}[i] \\gets \\text{false}$\n    $\\textsc{Opt}[i] \\gets \\textsc{Opt}[i-1]$\n  else\n    $\\textit{chosen}[i] \\gets \\text{true}$\n    $\\textsc{Opt}[i] \\gets p_i + \\textsc{Opt}[k]$\nreturn $\\textsc{Opt}[n],\\ \\textit{chosen}$\n",[869,8398,8399,8404,8409,8414,8418,8423,8427,8431,8436,8441,8446,8451,8456,8462],{"__ignoreMap":376},[421,8400,8401],{"class":873,"line":6},[421,8402,8403],{},"caption: $\\textsc{Iter-IS}^{\\prime}(I_1, \\dots, I_n)$ — also reconstruct the set\n",[421,8405,8406],{"class":873,"line":18},[421,8407,8408],{},"number: 5\n",[421,8410,8411],{"class":873,"line":24},[421,8412,8413],{},"sort intervals by increasing finish time $f_i$\n",[421,8415,8416],{"class":873,"line":73},[421,8417,7519],{},[421,8419,8420],{"class":873,"line":102},[421,8421,8422],{},"allocate boolean array $\\textit{chosen}[1..n]$\n",[421,8424,8425],{"class":873,"line":108},[421,8426,7524],{},[421,8428,8429],{"class":873,"line":116},[421,8430,7529],{},[421,8432,8433],{"class":873,"line":196},[421,8434,8435],{},"  if $\\textsc{Opt}[i-1] \\ge p_i + \\textsc{Opt}[k]$ then\n",[421,8437,8438],{"class":873,"line":202},[421,8439,8440],{},"    $\\textit{chosen}[i] \\gets \\text{false}$\n",[421,8442,8443],{"class":873,"line":283},[421,8444,8445],{},"    $\\textsc{Opt}[i] \\gets \\textsc{Opt}[i-1]$\n",[421,8447,8448],{"class":873,"line":333},[421,8449,8450],{},"  else\n",[421,8452,8453],{"class":873,"line":354},[421,8454,8455],{},"    $\\textit{chosen}[i] \\gets \\text{true}$\n",[421,8457,8459],{"class":873,"line":8458},13,[421,8460,8461],{},"    $\\textsc{Opt}[i] \\gets p_i + \\textsc{Opt}[k]$\n",[421,8463,8465],{"class":873,"line":8464},14,[421,8466,8467],{},"return $\\textsc{Opt}[n],\\ \\textit{chosen}$\n",[381,8469,8470,8471,8504,8505,8532,8533,8585,8586,8610,8611,8644,8645,392],{},"Trace back from ",[421,8472,8474],{"className":8473},[428],[421,8475,8477,8495],{"className":8476,"ariaHidden":433},[432],[421,8478,8480,8483,8486,8489,8492],{"className":8479},[437],[421,8481],{"className":8482,"style":4546},[441],[421,8484,3023],{"className":8485},[446,447],[421,8487],{"className":8488,"style":468},[467],[421,8490,473],{"className":8491},[472],[421,8493],{"className":8494,"style":468},[467],[421,8496,8498,8501],{"className":8497},[437],[421,8499],{"className":8500,"style":7602},[441],[421,8502,458],{"className":8503},[446,447],": if ",[421,8506,8508],{"className":8507},[428],[421,8509,8511],{"className":8510,"ariaHidden":433},[432],[421,8512,8514,8517,8523,8526,8529],{"className":8513},[437],[421,8515],{"className":8516,"style":442},[441],[421,8518,8520],{"className":8519},[446,756],[421,8521,8192],{"className":8522},[446,8191],[421,8524,2915],{"className":8525},[453],[421,8527,3023],{"className":8528},[446,447],[421,8530,2923],{"className":8531},[462],", output ",[421,8534,8536],{"className":8535},[428],[421,8537,8539],{"className":8538,"ariaHidden":433},[432],[421,8540,8542,8545],{"className":8541},[437],[421,8543],{"className":8544,"style":1242},[441],[421,8546,8548,8551],{"className":8547},[446],[421,8549,3339],{"className":8550,"style":3338},[446,447],[421,8552,8554],{"className":8553},[1252],[421,8555,8557,8577],{"className":8556},[499,500],[421,8558,8560,8574],{"className":8559},[504],[421,8561,8563],{"className":8562,"style":3468},[508],[421,8564,8565,8568],{"style":3354},[421,8566],{"className":8567,"style":1269},[516],[421,8569,8571],{"className":8570},[1273,1274,1275,1276],[421,8572,3023],{"className":8573},[446,447,1276],[421,8575,588],{"className":8576},[587],[421,8578,8580],{"className":8579},[504],[421,8581,8583],{"className":8582,"style":1290},[508],[421,8584],{}," and jump to ",[421,8587,8589],{"className":8588},[428],[421,8590,8592],{"className":8591,"ariaHidden":433},[432],[421,8593,8595,8598,8601,8604,8607],{"className":8594},[437],[421,8596],{"className":8597,"style":442},[441],[421,8599,4782],{"className":8600,"style":4781},[446,447],[421,8602,454],{"className":8603},[453],[421,8605,3023],{"className":8606},[446,447],[421,8608,463],{"className":8609},[462],";\notherwise step to ",[421,8612,8614],{"className":8613},[428],[421,8615,8617,8635],{"className":8616,"ariaHidden":433},[432],[421,8618,8620,8623,8626,8629,8632],{"className":8619},[437],[421,8621],{"className":8622,"style":7026},[441],[421,8624,3023],{"className":8625},[446,447],[421,8627],{"className":8628,"style":666},[467],[421,8630,671],{"className":8631},[670],[421,8633],{"className":8634,"style":666},[467],[421,8636,8638,8641],{"className":8637},[437],[421,8639],{"className":8640,"style":1560},[441],[421,8642,403],{"className":8643},[446],". This walk recovers an optimal set in ",[421,8646,8648],{"className":8647},[428],[421,8649,8651],{"className":8650,"ariaHidden":433},[432],[421,8652,8654,8657,8660,8663,8666],{"className":8653},[437],[421,8655],{"className":8656,"style":442},[441],[421,8658,7562],{"className":8659,"style":7561},[446,447],[421,8661,454],{"className":8662},[453],[421,8664,458],{"className":8665},[446,447],[421,8667,463],{"className":8668},[462],[413,8670,8672],{"id":8671},"a-second-worked-optimization-rod-cutting","A second worked optimization: rod cutting",[381,8674,8675,8676,8678,8679,8682,8683,8698,8699,8751,8752,8767],{},"The same recipe applied to ",[384,8677,3290],{}," (CLRS's opening case) shows a different\nflavor of choice — not binary, but ",[4782,8680,8681],{},"try every first piece."," Given a rod of integer\nlength ",[421,8684,8686],{"className":8685},[428],[421,8687,8689],{"className":8688,"ariaHidden":433},[432],[421,8690,8692,8695],{"className":8691},[437],[421,8693],{"className":8694,"style":7602},[441],[421,8696,458],{"className":8697},[446,447]," and a price ",[421,8700,8702],{"className":8701},[428],[421,8703,8705],{"className":8704,"ariaHidden":433},[432],[421,8706,8708,8711],{"className":8707},[437],[421,8709],{"className":8710,"style":3616},[441],[421,8712,8714,8717],{"className":8713},[446],[421,8715,381],{"className":8716},[446,447],[421,8718,8720],{"className":8719},[1252],[421,8721,8723,8743],{"className":8722},[499,500],[421,8724,8726,8740],{"className":8725},[504],[421,8727,8729],{"className":8728,"style":3468},[508],[421,8730,8731,8734],{"style":3530},[421,8732],{"className":8733,"style":1269},[516],[421,8735,8737],{"className":8736},[1273,1274,1275,1276],[421,8738,3023],{"className":8739},[446,447,1276],[421,8741,588],{"className":8742},[587],[421,8744,8746],{"className":8745},[504],[421,8747,8749],{"className":8748,"style":1290},[508],[421,8750],{}," for a piece of length ",[421,8753,8755],{"className":8754},[428],[421,8756,8758],{"className":8757,"ariaHidden":433},[432],[421,8759,8761,8764],{"className":8760},[437],[421,8762],{"className":8763,"style":4546},[441],[421,8765,3023],{"className":8766},[446,447],", cut the rod into integer\npieces to maximize total revenue. With the price table",[8769,8770,8771,8820],"table",{},[8772,8773,8774],"thead",{},[8775,8776,8777,8796,8798,8800,8802,8805,8807,8809,8812,8814,8817],"tr",{},[8778,8779,8780,8781],"th",{},"length ",[421,8782,8784],{"className":8783},[428],[421,8785,8787],{"className":8786,"ariaHidden":433},[432],[421,8788,8790,8793],{"className":8789},[437],[421,8791],{"className":8792,"style":4546},[441],[421,8794,3023],{"className":8795},[446,447],[8778,8797,403],{},[8778,8799,712],{},[8778,8801,1280],{},[8778,8803,8804],{},"4",[8778,8806,921],{},[8778,8808,5713],{},[8778,8810,8811],{},"7",[8778,8813,2618],{},[8778,8815,8816],{},"9",[8778,8818,8819],{},"10",[8821,8822,8823],"tbody",{},[8775,8824,8825,8881,8883,8885,8887,8889,8891,8894,8896,8899,8902],{},[8826,8827,8828,8829],"td",{},"price ",[421,8830,8832],{"className":8831},[428],[421,8833,8835],{"className":8834,"ariaHidden":433},[432],[421,8836,8838,8841],{"className":8837},[437],[421,8839],{"className":8840,"style":3616},[441],[421,8842,8844,8847],{"className":8843},[446],[421,8845,381],{"className":8846},[446,447],[421,8848,8850],{"className":8849},[1252],[421,8851,8853,8873],{"className":8852},[499,500],[421,8854,8856,8870],{"className":8855},[504],[421,8857,8859],{"className":8858,"style":3468},[508],[421,8860,8861,8864],{"style":3530},[421,8862],{"className":8863,"style":1269},[516],[421,8865,8867],{"className":8866},[1273,1274,1275,1276],[421,8868,3023],{"className":8869},[446,447,1276],[421,8871,588],{"className":8872},[587],[421,8874,8876],{"className":8875},[504],[421,8877,8879],{"className":8878,"style":1290},[508],[421,8880],{},[8826,8882,403],{},[8826,8884,921],{},[8826,8886,2618],{},[8826,8888,8816],{},[8826,8890,8819],{},[8826,8892,8893],{},"17",[8826,8895,8893],{},[8826,8897,8898],{},"20",[8826,8900,8901],{},"24",[8826,8903,8904],{},"30",[381,8906,8907,8908,8941,8942,8957,8958,8992,8993,9045],{},"a rod of length ",[421,8909,8911],{"className":8910},[428],[421,8912,8914,8932],{"className":8913,"ariaHidden":433},[432],[421,8915,8917,8920,8923,8926,8929],{"className":8916},[437],[421,8918],{"className":8919,"style":7602},[441],[421,8921,458],{"className":8922},[446,447],[421,8924],{"className":8925,"style":468},[467],[421,8927,473],{"className":8928},[472],[421,8930],{"className":8931,"style":468},[467],[421,8933,8935,8938],{"className":8934},[437],[421,8936],{"className":8937,"style":1560},[441],[421,8939,2618],{"className":8940},[446]," sells whole for ",[421,8943,8945],{"className":8944},[428],[421,8946,8948],{"className":8947,"ariaHidden":433},[432],[421,8949,8951,8954],{"className":8950},[437],[421,8952],{"className":8953,"style":1560},[441],[421,8955,8898],{"className":8956},[446],", but cutting it as ",[421,8959,8961],{"className":8960},[428],[421,8962,8964,8983],{"className":8963,"ariaHidden":433},[432],[421,8965,8967,8971,8974,8977,8980],{"className":8966},[437],[421,8968],{"className":8969,"style":8970},[441],"height:0.7278em;vertical-align:-0.0833em;",[421,8972,5713],{"className":8973},[446],[421,8975],{"className":8976,"style":666},[467],[421,8978,687],{"className":8979},[670],[421,8981],{"className":8982,"style":666},[467],[421,8984,8986,8989],{"className":8985},[437],[421,8987],{"className":8988,"style":1560},[441],[421,8990,712],{"className":8991},[446]," earns\n",[421,8994,8996],{"className":8995},[428],[421,8997,8999,9017,9035],{"className":8998,"ariaHidden":433},[432],[421,9000,9002,9005,9008,9011,9014],{"className":9001},[437],[421,9003],{"className":9004,"style":8970},[441],[421,9006,8893],{"className":9007},[446],[421,9009],{"className":9010,"style":666},[467],[421,9012,687],{"className":9013},[670],[421,9015],{"className":9016,"style":666},[467],[421,9018,9020,9023,9026,9029,9032],{"className":9019},[437],[421,9021],{"className":9022,"style":1560},[441],[421,9024,921],{"className":9025},[446],[421,9027],{"className":9028,"style":468},[467],[421,9030,473],{"className":9031},[472],[421,9033],{"className":9034,"style":468},[467],[421,9036,9038,9041],{"className":9037},[437],[421,9039],{"className":9040,"style":1560},[441],[421,9042,9044],{"className":9043},[446],"22"," — so the cuts matter.",[381,9047,9048,9051,9052,9055,9056,9086,9087,9102,9103,3657,9133,9136,9137,9140,9141,9157,9158,9210,9211,9264,9265,9298,9299,9314],{},[384,9049,9050],{},"Simplified goal."," Find just the maximum obtainable revenue. ",[384,9053,9054],{},"Subproblem."," Let\n",[421,9057,9059],{"className":9058},[428],[421,9060,9062],{"className":9061,"ariaHidden":433},[432],[421,9063,9065,9068,9077,9080,9083],{"className":9064},[437],[421,9066],{"className":9067,"style":442},[441],[421,9069,9071],{"className":9070},[1582,1583],[421,9072,9074],{"className":9073},[446,756],[421,9075,3162],{"className":9076},[446],[421,9078,454],{"className":9079},[453],[421,9081,3023],{"className":9082},[446,447],[421,9084,463],{"className":9085},[462]," be the max revenue from a rod of length ",[421,9088,9090],{"className":9089},[428],[421,9091,9093],{"className":9092,"ariaHidden":433},[432],[421,9094,9096,9099],{"className":9095},[437],[421,9097],{"className":9098,"style":4546},[441],[421,9100,3023],{"className":9101},[446,447],"; we want\n",[421,9104,9106],{"className":9105},[428],[421,9107,9109],{"className":9108,"ariaHidden":433},[432],[421,9110,9112,9115,9124,9127,9130],{"className":9111},[437],[421,9113],{"className":9114,"style":442},[441],[421,9116,9118],{"className":9117},[1582,1583],[421,9119,9121],{"className":9120},[446,756],[421,9122,3162],{"className":9123},[446],[421,9125,454],{"className":9126},[453],[421,9128,458],{"className":9129},[446,447],[421,9131,463],{"className":9132},[462],[384,9134,9135],{},"DP equations."," Consider the ",[389,9138,9139],{},"rightmost"," cut. If the rightmost\npiece has length ",[421,9142,9144],{"className":9143},[428],[421,9145,9147],{"className":9146,"ariaHidden":433},[432],[421,9148,9150,9154],{"className":9149},[437],[421,9151],{"className":9152,"style":9153},[441],"height:0.854em;vertical-align:-0.1944em;",[421,9155,4833],{"className":9156,"style":4832},[446,447]," (for some ",[421,9159,9161],{"className":9160},[428],[421,9162,9164,9183,9201],{"className":9163,"ariaHidden":433},[432],[421,9165,9167,9171,9174,9177,9180],{"className":9166},[437],[421,9168],{"className":9169,"style":9170},[441],"height:0.7804em;vertical-align:-0.136em;",[421,9172,403],{"className":9173},[446],[421,9175],{"className":9176,"style":468},[467],[421,9178,4292],{"className":9179},[472],[421,9181],{"className":9182,"style":468},[467],[421,9184,9186,9189,9192,9195,9198],{"className":9185},[437],[421,9187],{"className":9188,"style":9153},[441],[421,9190,4833],{"className":9191,"style":4832},[446,447],[421,9193],{"className":9194,"style":468},[467],[421,9196,4292],{"className":9197},[472],[421,9199],{"className":9200,"style":468},[467],[421,9202,9204,9207],{"className":9203},[437],[421,9205],{"className":9206,"style":4546},[441],[421,9208,3023],{"className":9209},[446,447],"), we earn ",[421,9212,9214],{"className":9213},[428],[421,9215,9217],{"className":9216,"ariaHidden":433},[432],[421,9218,9220,9224],{"className":9219},[437],[421,9221],{"className":9222,"style":9223},[441],"height:0.7167em;vertical-align:-0.2861em;",[421,9225,9227,9230],{"className":9226},[446],[421,9228,381],{"className":9229},[446,447],[421,9231,9233],{"className":9232},[1252],[421,9234,9236,9256],{"className":9235},[499,500],[421,9237,9239,9253],{"className":9238},[504],[421,9240,9242],{"className":9241,"style":3468},[508],[421,9243,9244,9247],{"style":3530},[421,9245],{"className":9246,"style":1269},[516],[421,9248,9250],{"className":9249},[1273,1274,1275,1276],[421,9251,4833],{"className":9252,"style":4832},[446,447,1276],[421,9254,588],{"className":9255},[587],[421,9257,9259],{"className":9258},[504],[421,9260,9262],{"className":9261,"style":4882},[508],[421,9263],{}," and cut the\nremaining length ",[421,9266,9268],{"className":9267},[428],[421,9269,9271,9289],{"className":9270,"ariaHidden":433},[432],[421,9272,9274,9277,9280,9283,9286],{"className":9273},[437],[421,9275],{"className":9276,"style":7026},[441],[421,9278,3023],{"className":9279},[446,447],[421,9281],{"className":9282,"style":666},[467],[421,9284,671],{"className":9285},[670],[421,9287],{"className":9288,"style":666},[467],[421,9290,9292,9295],{"className":9291},[437],[421,9293],{"className":9294,"style":9153},[441],[421,9296,4833],{"className":9297,"style":4832},[446,447]," optimally — optimal substructure. We do not know the best\n",[421,9300,9302],{"className":9301},[428],[421,9303,9305],{"className":9304,"ariaHidden":433},[432],[421,9306,9308,9311],{"className":9307},[437],[421,9309],{"className":9310,"style":9153},[441],[421,9312,4833],{"className":9313,"style":4832},[446,447],", so we try them all:",[421,9316,9318],{"className":9317},[424],[421,9319,9321],{"className":9320},[428],[421,9322,9324,9357],{"className":9323,"ariaHidden":433},[432],[421,9325,9327,9330,9339,9342,9345,9348,9351,9354],{"className":9326},[437],[421,9328],{"className":9329,"style":442},[441],[421,9331,9333],{"className":9332},[1582,1583],[421,9334,9336],{"className":9335},[446,756],[421,9337,3162],{"className":9338},[446],[421,9340,454],{"className":9341},[453],[421,9343,3023],{"className":9344},[446,447],[421,9346,463],{"className":9347},[462],[421,9349],{"className":9350,"style":468},[467],[421,9352,473],{"className":9353},[472],[421,9355],{"className":9356,"style":468},[467],[421,9358,9360,9364],{"className":9359},[437],[421,9361],{"className":9362,"style":9363},[441],"height:3.08em;vertical-align:-1.29em;",[421,9365,9367,9373,9658],{"className":9366},[487],[421,9368,9370],{"className":9369,"style":3682},[453,3681],[421,9371,3683],{"className":9372},[494,6092],[421,9374,9376],{"className":9375},[446],[421,9377,9379,9571,9574],{"className":9378},[604],[421,9380,9382],{"className":9381},[608],[421,9383,9385,9563],{"className":9384},[499,500],[421,9386,9388,9560],{"className":9387},[504],[421,9389,9391,9402],{"className":9390,"style":6111},[508],[421,9392,9393,9396],{"style":6114},[421,9394],{"className":9395,"style":625},[516],[421,9397,9399],{"className":9398},[446],[421,9400,632],{"className":9401},[446],[421,9403,9404,9407],{"style":6153},[421,9405],{"className":9406,"style":625},[516],[421,9408,9410,9469,9475,9515,9518,9521,9524,9533,9536,9539,9542,9545,9548,9551,9554],{"className":9409},[446],[421,9411,9413,9419],{"className":9412},[4811],[421,9414,9416],{"className":9415},[4811],[421,9417,4816],{"className":9418},[446,4815],[421,9420,9422],{"className":9421},[1252],[421,9423,9425,9461],{"className":9424},[499,500],[421,9426,9428,9458],{"className":9427},[504],[421,9429,9431],{"className":9430,"style":3468},[508],[421,9432,9434,9437],{"style":9433},"top:-2.55em;margin-right:0.05em;",[421,9435],{"className":9436,"style":1269},[516],[421,9438,9440],{"className":9439},[1273,1274,1275,1276],[421,9441,9443,9446,9449,9452,9455],{"className":9442},[446,1276],[421,9444,403],{"className":9445},[446,1276],[421,9447,4292],{"className":9448},[472,1276],[421,9450,4833],{"className":9451,"style":4832},[446,447,1276],[421,9453,4292],{"className":9454},[472,1276],[421,9456,3023],{"className":9457},[446,447,1276],[421,9459,588],{"className":9460},[587],[421,9462,9464],{"className":9463},[504],[421,9465,9467],{"className":9466,"style":4882},[508],[421,9468],{},[421,9470,9472],{"className":9471},[453],[421,9473,454],{"className":9474},[494,3743],[421,9476,9478,9481],{"className":9477},[446],[421,9479,381],{"className":9480},[446,447],[421,9482,9484],{"className":9483},[1252],[421,9485,9487,9507],{"className":9486},[499,500],[421,9488,9490,9504],{"className":9489},[504],[421,9491,9493],{"className":9492,"style":3468},[508],[421,9494,9495,9498],{"style":3530},[421,9496],{"className":9497,"style":1269},[516],[421,9499,9501],{"className":9500},[1273,1274,1275,1276],[421,9502,4833],{"className":9503,"style":4832},[446,447,1276],[421,9505,588],{"className":9506},[587],[421,9508,9510],{"className":9509},[504],[421,9511,9513],{"className":9512,"style":4882},[508],[421,9514],{},[421,9516],{"className":9517,"style":666},[467],[421,9519,687],{"className":9520},[670],[421,9522],{"className":9523,"style":666},[467],[421,9525,9527],{"className":9526},[1582,1583],[421,9528,9530],{"className":9529},[446,756],[421,9531,3162],{"className":9532},[446],[421,9534,454],{"className":9535},[453],[421,9537,3023],{"className":9538},[446,447],[421,9540],{"className":9541,"style":666},[467],[421,9543,671],{"className":9544},[670],[421,9546],{"className":9547,"style":666},[467],[421,9549,4833],{"className":9550,"style":4832},[446,447],[421,9552,463],{"className":9553},[462],[421,9555,9557],{"className":9556},[462],[421,9558,463],{"className":9559},[494,3743],[421,9561,588],{"className":9562},[587],[421,9564,9566],{"className":9565},[504],[421,9567,9569],{"className":9568,"style":6242},[508],[421,9570],{},[421,9572],{"className":9573,"style":732},[731],[421,9575,9577],{"className":9576},[608],[421,9578,9580,9650],{"className":9579},[499,500],[421,9581,9583,9647],{"className":9582},[504],[421,9584,9586,9618],{"className":9585,"style":6111},[508],[421,9587,9588,9591],{"style":6114},[421,9589],{"className":9590,"style":625},[516],[421,9592,9594,9600,9603,9606,9609,9612,9615],{"className":9593},[446],[421,9595,9597],{"className":9596},[446,756],[421,9598,760],{"className":9599},[446],[421,9601,3023],{"className":9602},[446,447],[421,9604],{"className":9605,"style":468},[467],[421,9607,473],{"className":9608},[472],[421,9610],{"className":9611,"style":468},[467],[421,9613,632],{"className":9614},[446],[421,9616,780],{"className":9617},[779],[421,9619,9620,9623],{"style":6153},[421,9621],{"className":9622,"style":625},[516],[421,9624,9626,9632,9635,9638,9641,9644],{"className":9625},[446],[421,9627,9629],{"className":9628},[446,756],[421,9630,760],{"className":9631},[446],[421,9633,3023],{"className":9634},[446,447],[421,9636],{"className":9637,"style":468},[467],[421,9639,836],{"className":9640},[472],[421,9642],{"className":9643,"style":468},[467],[421,9645,6472],{"className":9646},[446],[421,9648,588],{"className":9649},[587],[421,9651,9653],{"className":9652},[504],[421,9654,9656],{"className":9655,"style":6242},[508],[421,9657],{},[421,9659],{"className":9660},[462,858],[381,9662,9663,9664,9730],{},"The subproblems ",[421,9665,9667],{"className":9666},[428],[421,9668,9670],{"className":9669,"ariaHidden":433},[432],[421,9671,9673,9676,9685,9688,9691,9694,9697,9700,9703,9706,9709,9712,9721,9724,9727],{"className":9672},[437],[421,9674],{"className":9675,"style":442},[441],[421,9677,9679],{"className":9678},[1582,1583],[421,9680,9682],{"className":9681},[446,756],[421,9683,3162],{"className":9684},[446],[421,9686,454],{"className":9687},[453],[421,9689,632],{"className":9690},[446],[421,9692,463],{"className":9693},[462],[421,9695,780],{"className":9696},[779],[421,9698],{"className":9699,"style":1715},[467],[421,9701,1737],{"className":9702},[487],[421,9704],{"className":9705,"style":1715},[467],[421,9707,780],{"className":9708},[779],[421,9710],{"className":9711,"style":1715},[467],[421,9713,9715],{"className":9714},[1582,1583],[421,9716,9718],{"className":9717},[446,756],[421,9719,3162],{"className":9720},[446],[421,9722,454],{"className":9723},[453],[421,9725,458],{"className":9726},[446,447],[421,9728,463],{"className":9729},[462]," are ordered by length, so\nwe fill them in increasing order.",[863,9732,9734],{"className":865,"code":9733,"language":867,"meta":376,"style":376},"caption: $\\textsc{Cut-Rod}(p[1..n])$ — maximum revenue cutting a length-$n$ rod\nnumber: 6\n$\\textsc{Opt}[0..n] \\gets 0$\nfor $i \\gets 1$ to $n$ do\n  for $j \\gets 1$ to $i$ do\n    $\\textsc{Opt}[i] \\gets \\max\\bigl(\\textsc{Opt}[i],\\ p[j] + \\textsc{Opt}[i-j]\\bigr)$ \u002F\u002F rightmost piece length $j$\nreturn $\\textsc{Opt}[n]$\n",[869,9735,9736,9741,9746,9751,9755,9760,9765],{"__ignoreMap":376},[421,9737,9738],{"class":873,"line":6},[421,9739,9740],{},"caption: $\\textsc{Cut-Rod}(p[1..n])$ — maximum revenue cutting a length-$n$ rod\n",[421,9742,9743],{"class":873,"line":18},[421,9744,9745],{},"number: 6\n",[421,9747,9748],{"class":873,"line":24},[421,9749,9750],{},"$\\textsc{Opt}[0..n] \\gets 0$\n",[421,9752,9753],{"class":873,"line":73},[421,9754,7524],{},[421,9756,9757],{"class":873,"line":102},[421,9758,9759],{},"  for $j \\gets 1$ to $i$ do\n",[421,9761,9762],{"class":873,"line":108},[421,9763,9764],{},"    $\\textsc{Opt}[i] \\gets \\max\\bigl(\\textsc{Opt}[i],\\ p[j] + \\textsc{Opt}[i-j]\\bigr)$ \u002F\u002F rightmost piece length $j$\n",[421,9766,9767],{"class":873,"line":116},[421,9768,7539],{},[381,9770,9771,9774,9775,9790,9791,9821,9822,9844,9845,9860,9861,9876],{},[384,9772,9773],{},"Running time."," There are ",[421,9776,9778],{"className":9777},[428],[421,9779,9781],{"className":9780,"ariaHidden":433},[432],[421,9782,9784,9787],{"className":9783},[437],[421,9785],{"className":9786,"style":7602},[441],[421,9788,458],{"className":9789},[446,447]," subproblems, and the work to compute\n",[421,9792,9794],{"className":9793},[428],[421,9795,9797],{"className":9796,"ariaHidden":433},[432],[421,9798,9800,9803,9812,9815,9818],{"className":9799},[437],[421,9801],{"className":9802,"style":442},[441],[421,9804,9806],{"className":9805},[1582,1583],[421,9807,9809],{"className":9808},[446,756],[421,9810,3162],{"className":9811},[446],[421,9813,2915],{"className":9814},[453],[421,9816,3023],{"className":9817},[446,447],[421,9819,2923],{"className":9820},[462]," is at most ",[421,9823,9825],{"className":9824},[428],[421,9826,9828],{"className":9827,"ariaHidden":433},[432],[421,9829,9831,9834,9838,9841],{"className":9830},[437],[421,9832],{"className":9833,"style":1578},[441],[421,9835,9837],{"className":9836},[446,447],"b",[421,9839],{"className":9840,"style":1715},[467],[421,9842,3023],{"className":9843},[446,447]," for a constant ",[421,9846,9848],{"className":9847},[428],[421,9849,9851],{"className":9850,"ariaHidden":433},[432],[421,9852,9854,9857],{"className":9853},[437],[421,9855],{"className":9856,"style":1578},[441],[421,9858,9837],{"className":9859},[446,447]," (the inner loop runs ",[421,9862,9864],{"className":9863},[428],[421,9865,9867],{"className":9866,"ariaHidden":433},[432],[421,9868,9870,9873],{"className":9869},[437],[421,9871],{"className":9872,"style":4546},[441],[421,9874,3023],{"className":9875},[446,447],"\ntimes). Summing,",[421,9878,9880],{"className":9879},[424],[421,9881,9883],{"className":9882},[428],[421,9884,9886,9914,9941,10046,10073,10091,10198],{"className":9885,"ariaHidden":433},[432],[421,9887,9889,9892,9896,9899,9902,9905,9908,9911],{"className":9888},[437],[421,9890],{"className":9891,"style":442},[441],[421,9893,9895],{"className":9894,"style":448},[446,447],"T",[421,9897,454],{"className":9898},[453],[421,9900,458],{"className":9901},[446,447],[421,9903,463],{"className":9904},[462],[421,9906],{"className":9907,"style":468},[467],[421,9909,473],{"className":9910},[472],[421,9912],{"className":9913,"style":468},[467],[421,9915,9917,9920,9923,9926,9929,9932,9935,9938],{"className":9916},[437],[421,9918],{"className":9919,"style":442},[441],[421,9921,7562],{"className":9922,"style":7561},[446,447],[421,9924,454],{"className":9925},[453],[421,9927,458],{"className":9928},[446,447],[421,9930,463],{"className":9931},[462],[421,9933],{"className":9934,"style":666},[467],[421,9936,687],{"className":9937},[670],[421,9939],{"className":9940,"style":666},[467],[421,9942,9944,9948,10025,10028,10031,10034,10037,10040,10043],{"className":9943},[437],[421,9945],{"className":9946,"style":9947},[441],"height:2.9291em;vertical-align:-1.2777em;",[421,9949,9952],{"className":9950},[4811,9951],"op-limits",[421,9953,9955,10016],{"className":9954},[499,500],[421,9956,9958,10013],{"className":9957},[504],[421,9959,9962,9984,9998],{"className":9960,"style":9961},[508],"height:1.6514em;",[421,9963,9965,9969],{"style":9964},"top:-1.8723em;margin-left:0em;",[421,9966],{"className":9967,"style":9968},[516],"height:3.05em;",[421,9970,9972],{"className":9971},[1273,1274,1275,1276],[421,9973,9975,9978,9981],{"className":9974},[446,1276],[421,9976,3023],{"className":9977},[446,447,1276],[421,9979,473],{"className":9980},[472,1276],[421,9982,403],{"className":9983},[446,1276],[421,9985,9987,9990],{"style":9986},"top:-3.05em;",[421,9988],{"className":9989,"style":9968},[516],[421,9991,9992],{},[421,9993,9997],{"className":9994},[4811,9995,9996],"op-symbol","large-op","∑",[421,9999,10001,10004],{"style":10000},"top:-4.3em;margin-left:0em;",[421,10002],{"className":10003,"style":9968},[516],[421,10005,10007],{"className":10006},[1273,1274,1275,1276],[421,10008,10010],{"className":10009},[446,1276],[421,10011,458],{"className":10012},[446,447,1276],[421,10014,588],{"className":10015},[587],[421,10017,10019],{"className":10018},[504],[421,10020,10023],{"className":10021,"style":10022},[508],"height:1.2777em;",[421,10024],{},[421,10026],{"className":10027,"style":1715},[467],[421,10029,9837],{"className":10030},[446,447],[421,10032],{"className":10033,"style":1715},[467],[421,10035,3023],{"className":10036},[446,447],[421,10038],{"className":10039,"style":468},[467],[421,10041,473],{"className":10042},[472],[421,10044],{"className":10045,"style":468},[467],[421,10047,10049,10052,10055,10058,10061,10064,10067,10070],{"className":10048},[437],[421,10050],{"className":10051,"style":442},[441],[421,10053,7562],{"className":10054,"style":7561},[446,447],[421,10056,454],{"className":10057},[453],[421,10059,458],{"className":10060},[446,447],[421,10062,463],{"className":10063},[462],[421,10065],{"className":10066,"style":666},[467],[421,10068,687],{"className":10069},[670],[421,10071],{"className":10072,"style":666},[467],[421,10074,10076,10079,10082,10085,10088],{"className":10075},[437],[421,10077],{"className":10078,"style":1578},[441],[421,10080,9837],{"className":10081},[446,447],[421,10083],{"className":10084,"style":666},[467],[421,10086,3169],{"className":10087},[670],[421,10089],{"className":10090,"style":666},[467],[421,10092,10094,10098,10189,10192,10195],{"className":10093},[437],[421,10095],{"className":10096,"style":10097},[441],"height:2.113em;vertical-align:-0.686em;",[421,10099,10101,10104,10186],{"className":10100},[446],[421,10102],{"className":10103},[453,858],[421,10105,10108],{"className":10106},[10107],"mfrac",[421,10109,10111,10177],{"className":10110},[499,500],[421,10112,10114,10174],{"className":10113},[504],[421,10115,10118,10130,10141],{"className":10116,"style":10117},[508],"height:1.427em;",[421,10119,10121,10124],{"style":10120},"top:-2.314em;",[421,10122],{"className":10123,"style":1500},[516],[421,10125,10127],{"className":10126},[446],[421,10128,712],{"className":10129},[446],[421,10131,10133,10136],{"style":10132},"top:-3.23em;",[421,10134],{"className":10135,"style":1500},[516],[421,10137],{"className":10138,"style":10140},[10139],"frac-line","border-bottom-width:0.04em;",[421,10142,10144,10147],{"style":10143},"top:-3.677em;",[421,10145],{"className":10146,"style":1500},[516],[421,10148,10150,10153,10156,10159,10162,10165,10168,10171],{"className":10149},[446],[421,10151,458],{"className":10152},[446,447],[421,10154,454],{"className":10155},[453],[421,10157,458],{"className":10158},[446,447],[421,10160],{"className":10161,"style":666},[467],[421,10163,687],{"className":10164},[670],[421,10166],{"className":10167,"style":666},[467],[421,10169,403],{"className":10170},[446],[421,10172,463],{"className":10173},[462],[421,10175,588],{"className":10176},[587],[421,10178,10180],{"className":10179},[504],[421,10181,10184],{"className":10182,"style":10183},[508],"height:0.686em;",[421,10185],{},[421,10187],{"className":10188},[462,858],[421,10190],{"className":10191,"style":468},[467],[421,10193,473],{"className":10194},[472],[421,10196],{"className":10197,"style":468},[467],[421,10199,10201,10205,10208,10211,10242,10245],{"className":10200},[437],[421,10202],{"className":10203,"style":10204},[441],"height:1.1141em;vertical-align:-0.25em;",[421,10206,7562],{"className":10207,"style":7561},[446,447],[421,10209,454],{"className":10210},[453],[421,10212,10214,10217],{"className":10213},[446],[421,10215,458],{"className":10216},[446,447],[421,10218,10220],{"className":10219},[1252],[421,10221,10223],{"className":10222},[499],[421,10224,10226],{"className":10225},[504],[421,10227,10230],{"className":10228,"style":10229},[508],"height:0.8641em;",[421,10231,10233,10236],{"style":10232},"top:-3.113em;margin-right:0.05em;",[421,10234],{"className":10235,"style":1269},[516],[421,10237,10239],{"className":10238},[1273,1274,1275,1276],[421,10240,712],{"className":10241},[446,1276],[421,10243,463],{"className":10244},[462],[421,10246,780],{"className":10247},[779],[381,10249,10250,10251,10312,10313,10328,10329,10356,10357,392],{},"a polynomial replacement for the ",[421,10252,10254],{"className":10253},[428],[421,10255,10257],{"className":10256,"ariaHidden":433},[432],[421,10258,10260,10264,10267,10270,10309],{"className":10259},[437],[421,10261],{"className":10262,"style":10263},[441],"height:1.0641em;vertical-align:-0.25em;",[421,10265,1362],{"className":10266},[446],[421,10268,454],{"className":10269},[453],[421,10271,10273,10276],{"className":10272},[446],[421,10274,712],{"className":10275},[446],[421,10277,10279],{"className":10278},[1252],[421,10280,10282],{"className":10281},[499],[421,10283,10285],{"className":10284},[504],[421,10286,10289],{"className":10287,"style":10288},[508],"height:0.8141em;",[421,10290,10291,10294],{"style":1415},[421,10292],{"className":10293,"style":1269},[516],[421,10295,10297],{"className":10296},[1273,1274,1275,1276],[421,10298,10300,10303,10306],{"className":10299},[446,1276],[421,10301,458],{"className":10302},[446,447,1276],[421,10304,671],{"className":10305},[670,1276],[421,10307,403],{"className":10308},[446,1276],[421,10310,463],{"className":10311},[462]," ways to cut the rod that a naive\nrecursion would explore. To recover the cuts, store the winning length ",[421,10314,10316],{"className":10315},[428],[421,10317,10319],{"className":10318,"ariaHidden":433},[432],[421,10320,10322,10325],{"className":10321},[437],[421,10323],{"className":10324,"style":9153},[441],[421,10326,4833],{"className":10327,"style":4832},[446,447]," in a\nsecond array ",[421,10330,10332],{"className":10331},[428],[421,10333,10335],{"className":10334,"ariaHidden":433},[432],[421,10336,10338,10341,10347,10350,10353],{"className":10337},[437],[421,10339],{"className":10340,"style":442},[441],[421,10342,10344],{"className":10343},[446,756],[421,10345,9139],{"className":10346},[446,8191],[421,10348,2915],{"className":10349},[453],[421,10351,3023],{"className":10352},[446,447],[421,10354,2923],{"className":10355},[462],", then read them off by following\n",[421,10358,10360],{"className":10359},[428],[421,10361,10363,10382,10400,10430,10448],{"className":10362,"ariaHidden":433},[432],[421,10364,10366,10369,10372,10375,10379],{"className":10365},[437],[421,10367],{"className":10368,"style":7602},[441],[421,10370,458],{"className":10371},[446,447],[421,10373],{"className":10374,"style":468},[467],[421,10376,10378],{"className":10377},[472],"→",[421,10380],{"className":10381,"style":468},[467],[421,10383,10385,10388,10391,10394,10397],{"className":10384},[437],[421,10386],{"className":10387,"style":1658},[441],[421,10389,458],{"className":10390},[446,447],[421,10392],{"className":10393,"style":666},[467],[421,10395,671],{"className":10396},[670],[421,10398],{"className":10399,"style":666},[467],[421,10401,10403,10406,10412,10415,10418,10421,10424,10427],{"className":10402},[437],[421,10404],{"className":10405,"style":442},[441],[421,10407,10409],{"className":10408},[446,756],[421,10410,9139],{"className":10411},[446,8191],[421,10413,2915],{"className":10414},[453],[421,10416,458],{"className":10417},[446,447],[421,10419,2923],{"className":10420},[462],[421,10422],{"className":10423,"style":468},[467],[421,10425,10378],{"className":10426},[472],[421,10428],{"className":10429,"style":468},[467],[421,10431,10433,10436,10439,10442,10445],{"className":10432},[437],[421,10434],{"className":10435,"style":7061},[441],[421,10437,3995],{"className":10438},[487],[421,10440],{"className":10441,"style":468},[467],[421,10443,10378],{"className":10444},[472],[421,10446],{"className":10447,"style":468},[467],[421,10449,10451,10454],{"className":10450},[437],[421,10452],{"className":10453,"style":1560},[441],[421,10455,632],{"className":10456},[446],[863,10458,10460],{"className":865,"code":10459,"language":867,"meta":376,"style":376},"caption: $\\textsc{Print-Cut-Rod}(p[1..n])$ — print an optimal set of cuts\nnumber: 7\n$\\textit{opt}, \\textit{rightmost} \\gets \\textsc{Cut-Rod}^{\\prime}(p)$ \u002F\u002F also returns cut lengths\nwhile $n > 0$ do\n  print $\\textit{rightmost}[n]$\n  $n \\gets n - \\textit{rightmost}[n]$\n",[869,10461,10462,10467,10472,10477,10482,10487],{"__ignoreMap":376},[421,10463,10464],{"class":873,"line":6},[421,10465,10466],{},"caption: $\\textsc{Print-Cut-Rod}(p[1..n])$ — print an optimal set of cuts\n",[421,10468,10469],{"class":873,"line":18},[421,10470,10471],{},"number: 7\n",[421,10473,10474],{"class":873,"line":24},[421,10475,10476],{},"$\\textit{opt}, \\textit{rightmost} \\gets \\textsc{Cut-Rod}^{\\prime}(p)$ \u002F\u002F also returns cut lengths\n",[421,10478,10479],{"class":873,"line":73},[421,10480,10481],{},"while $n > 0$ do\n",[421,10483,10484],{"class":873,"line":102},[421,10485,10486],{},"  print $\\textit{rightmost}[n]$\n",[421,10488,10489],{"class":873,"line":108},[421,10490,10491],{},"  $n \\gets n - \\textit{rightmost}[n]$\n",[413,10493,10495],{"id":10494},"takeaways","Takeaways",[10497,10498,10499,10505,10515,10524,10531,10538],"ul",{},[3118,10500,10501,10504],{},[384,10502,10503],{},"Dynamic programming is recursion without repetition",": find a recursive\nstructure, then solve each distinct subproblem once and store the result.",[3118,10506,10507,10508,10511,10512,10514],{},"It applies exactly when the problem has ",[384,10509,10510],{},"overlapping subproblems"," (so caching\nhelps) and ",[384,10513,3230],{}," (so a recurrence over subproblems is\ncorrect).",[3118,10516,10517,10520,10521,10523],{},[384,10518,10519],{},"Memoization"," (top-down) caches results inside the natural recursion;\n",[384,10522,2439],{}," (bottom-up) fills the table with a loop in dependency order. Same\nvalues, same time; tabulation often saves space.",[3118,10525,10526,10527,10530],{},"The ",[384,10528,10529],{},"DP recipe"," develops every dynamic program systematically:\nsimplified goal → define subproblems\u002Fnotation → DP equations → prove correctness\nby induction → iterative pseudocode → recover the original object → runtime.",[3118,10532,10533,10534,10537],{},"The hardest step is ",[384,10535,10536],{},"defining the subproblem","; a smart preprocessing choice can\nmake it cheap: sorting intervals by finish time reduces every subproblem to a\nprefix named by one index.",[3118,10539,10540,10541,10556,10557,10560,10561,10556,10577,10579,10580,10604,10605,10644,10645,392],{},"Running time ",[421,10542,10544],{"className":10543},[428],[421,10545,10547],{"className":10546,"ariaHidden":433},[432],[421,10548,10550,10553],{"className":10549},[437],[421,10551],{"className":10552,"style":7061},[441],[421,10554,473],{"className":10555},[472]," (",[384,10558,10559],{},"number of subproblems",") ",[421,10562,10564],{"className":10563},[428],[421,10565,10567],{"className":10566,"ariaHidden":433},[432],[421,10568,10570,10573],{"className":10569},[437],[421,10571],{"className":10572,"style":1658},[441],[421,10574,10576],{"className":10575},[446],"×",[384,10578,3279],{},"):\nFibonacci becomes ",[421,10581,10583],{"className":10582},[428],[421,10584,10586],{"className":10585,"ariaHidden":433},[432],[421,10587,10589,10592,10595,10598,10601],{"className":10588},[437],[421,10590],{"className":10591,"style":442},[441],[421,10593,1362],{"className":10594},[446],[421,10596,454],{"className":10597},[453],[421,10599,458],{"className":10600},[446,447],[421,10602,463],{"className":10603},[462],", weighted interval scheduling ",[421,10606,10608],{"className":10607},[428],[421,10609,10611],{"className":10610,"ariaHidden":433},[432],[421,10612,10614,10617,10620,10623,10626,10629,10635,10638,10641],{"className":10613},[437],[421,10615],{"className":10616,"style":442},[441],[421,10618,7562],{"className":10619,"style":7561},[446,447],[421,10621,454],{"className":10622},[453],[421,10624,458],{"className":10625},[446,447],[421,10627],{"className":10628,"style":1715},[467],[421,10630,10632],{"className":10631},[4811],[421,10633,7579],{"className":10634,"style":7578},[446,4815],[421,10636],{"className":10637,"style":1715},[467],[421,10639,458],{"className":10640},[446,447],[421,10642,463],{"className":10643},[462],", rod\ncutting ",[421,10646,10648],{"className":10647},[428],[421,10649,10651],{"className":10650,"ariaHidden":433},[432],[421,10652,10654,10657,10660,10663,10692],{"className":10653},[437],[421,10655],{"className":10656,"style":10263},[441],[421,10658,1362],{"className":10659},[446],[421,10661,454],{"className":10662},[453],[421,10664,10666,10669],{"className":10665},[446],[421,10667,458],{"className":10668},[446,447],[421,10670,10672],{"className":10671},[1252],[421,10673,10675],{"className":10674},[499],[421,10676,10678],{"className":10677},[504],[421,10679,10681],{"className":10680,"style":10288},[508],[421,10682,10683,10686],{"style":1415},[421,10684],{"className":10685,"style":1269},[516],[421,10687,10689],{"className":10688},[1273,1274,1275,1276],[421,10690,712],{"className":10691},[446,1276],[421,10693,463],{"className":10694},[462],[10696,10697,10700,10705],"section",{"className":10698,"dataFootnotes":376},[10699],"footnotes",[413,10701,10704],{"className":10702,"id":401},[10703],"sr-only","Footnotes",[3115,10706,10707,10724,10736],{},[3118,10708,10710,10713,10714,1680,10717],{"id":10709},"user-content-fn-erickson-dp",[384,10711,10712],{},"Erickson",", Ch. 3 — Dynamic Programming: the working definition of dynamic programming as ",[4782,10715,10716],{},"recursion without repetition.",[397,10718,10723],{"href":10719,"ariaLabel":10720,"className":10721,"dataFootnoteBackref":376},"#user-content-fnref-erickson-dp","Back to reference 1",[10722],"data-footnote-backref","↩",[3118,10725,10727,10730,10731],{"id":10726},"user-content-fn-skiena-dp",[384,10728,10729],{},"Skiena",", §10 — Dynamic Programming: top-down memoization as caching results inside the natural recursion. ",[397,10732,10723],{"href":10733,"ariaLabel":10734,"className":10735,"dataFootnoteBackref":376},"#user-content-fnref-skiena-dp","Back to reference 2",[10722],[3118,10737,10739,10742,10743],{"id":10738},"user-content-fn-clrs-dp",[384,10740,10741],{},"CLRS",", Ch. 15 — Dynamic Programming: the optimal-substructure cut-and-paste test for a correct recurrence. ",[397,10744,10723],{"href":10745,"ariaLabel":10746,"className":10747,"dataFootnoteBackref":376},"#user-content-fnref-clrs-dp","Back to reference 3",[10722],[10749,10750,10751],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark-mode .shiki span {color: var(--shiki-dark-mode);background: var(--shiki-dark-mode-bg);font-style: var(--shiki-dark-mode-font-style);font-weight: var(--shiki-dark-mode-font-weight);text-decoration: var(--shiki-dark-mode-text-decoration);}html.dark-mode .shiki span {color: var(--shiki-dark-mode);background: var(--shiki-dark-mode-bg);font-style: var(--shiki-dark-mode-font-style);font-weight: var(--shiki-dark-mode-font-weight);text-decoration: var(--shiki-dark-mode-text-decoration);}",{"title":376,"searchDepth":18,"depth":18,"links":10753},[10754,10755,10756,10757,10758,10759,10760,10761,10762],{"id":415,"depth":18,"text":416},{"id":1762,"depth":18,"text":1763},{"id":2424,"depth":18,"text":2425},{"id":3055,"depth":18,"text":3056},{"id":3101,"depth":18,"text":3102},{"id":3293,"depth":18,"text":3294},{"id":8671,"depth":18,"text":8672},{"id":10494,"depth":18,"text":10495},{"id":401,"depth":18,"text":10704},"Dynamic programming is one of the most powerful and most misunderstood\nideas in algorithm design. The name, coined by Richard Bellman in the 1950s, is\na historical accident: it has nothing to do with dynamics and little to do with\nprogramming in the modern sense. Erickson gives a one-line definition\nthat cuts through the mystique: dynamic programming is recursion without\nrepetition.1 We find a recursive structure for the problem, notice that the\nnaive recursion solves the same subproblems over and over, and then arrange to\nsolve each distinct subproblem exactly once, remembering its answer.","md",{"moduleNumber":116,"lessonNumber":6,"order":10766},701,true,[10769,10773,10776,10779,10783],{"title":10770,"slug":10771,"difficulty":10772},"Climbing Stairs","climbing-stairs","Easy",{"title":10774,"slug":10775,"difficulty":10772},"Fibonacci Number","fibonacci-number",{"title":10777,"slug":10778,"difficulty":10772},"Min Cost Climbing Stairs","min-cost-climbing-stairs",{"title":10780,"slug":10781,"difficulty":10782},"House Robber","house-robber","Medium",{"title":10784,"slug":10785,"difficulty":10782},"Unique Paths","unique-paths","---\ntitle: Principles of Dynamic Programming\nmodule: Dynamic Programming\nmoduleNumber: 7\nlessonNumber: 1\norder: 701\nsummary: >-\n  Dynamic programming is recursion with memory: when a recursive solution\n  re-solves the same subproblems again and again, we solve each one once and\n  store the answer. We pin down the two structural conditions that make this\n  work — overlapping subproblems and optimal substructure — contrast top-down\n  memoization with bottom-up tabulation, and distil the whole method into a\n  five-step recipe.\ntopics: [Dynamic Programming, Recurrences]\nsources:\n  - book: CLRS\n    ref: \"Ch. 15 — Dynamic Programming\"\n  - book: Skiena\n    ref: \"§10 — Dynamic Programming\"\n  - book: Erickson\n    ref: \"Ch. 3 — Dynamic Programming\"\npractice:\n  - title: 'Climbing Stairs'\n    slug: climbing-stairs\n    difficulty: Easy\n  - title: 'Fibonacci Number'\n    slug: fibonacci-number\n    difficulty: Easy\n  - title: 'Min Cost Climbing Stairs'\n    slug: min-cost-climbing-stairs\n    difficulty: Easy\n  - title: 'House Robber'\n    slug: house-robber\n    difficulty: Medium\n  - title: 'Unique Paths'\n    slug: unique-paths\n    difficulty: Medium\n---\n\n**Dynamic programming** is one of the most powerful and most misunderstood\nideas in algorithm design. The name, coined by Richard Bellman in the 1950s, is\na historical accident: it has nothing to do with dynamics and little to do with\nprogramming in the modern sense. Erickson gives a one-line definition\nthat cuts through the mystique: dynamic programming is _recursion without\nrepetition_.[^erickson-dp] We find a recursive structure for the problem, notice that the\nnaive recursion solves the same subproblems over and over, and then arrange to\nsolve each distinct subproblem exactly once, remembering its answer.\n\nThat single move, trading repeated computation for stored results, can\ncollapse an exponential running time to a polynomial one. The rest is bookkeeping:\nidentifying the subproblems, writing the [recurrence](\u002Falgorithms\u002Ffoundations\u002Frecurrences) that relates them, and\ndeciding the order in which to fill in the answers.\n\n## A motivating disaster: Fibonacci\n\nThe Fibonacci numbers are defined by the recurrence\n$$\nF(n) =\n\\begin{cases}\n0 & \\text{if } n = 0, \\\\[2pt]\n1 & \\text{if } n = 1, \\\\[2pt]\nF(n-1) + F(n-2) & \\text{if } n \\ge 2.\n\\end{cases}\n$$\nTranscribed directly into a recursive procedure, this definition is correct and\ncatastrophically slow.\n\n```algorithm\ncaption: $\\textsc{Rec-Fib}(n)$ — naive recursive Fibonacci\nnumber: 1\nif $n \u003C 2$ then\n  return $n$\nreturn $\\textsc{Rec-Fib}(n-1)$ **+** $\\textsc{Rec-Fib}(n-2)$\n```\n\nWhy is it slow? Because it recomputes the same values an astronomical number of\ntimes. The recursion tree for $F(5)$ shows the waste already:\n\n$$\n% caption: Recursion tree for $F(5)$ showing repeated subproblems recomputed many times.\n\\begin{tikzpicture}[\n  level distance=11mm,\n  every node\u002F.style={draw, circle, minimum size=7mm, inner sep=1pt},\n  level 1\u002F.style={sibling distance=38mm},\n  level 2\u002F.style={sibling distance=19mm},\n  level 3\u002F.style={sibling distance=11mm}]\n  \\node {$F_5$}\n    child {node {$F_4$}\n      child {node {$F_3$}\n        child {node {$F_2$}\n          child {node {$F_1$}}\n          child {node {$F_0$}}}\n        child {node {$F_1$}}}\n      child {node {$F_2$}\n        child {node {$F_1$}}\n        child {node {$F_0$}}}}\n    child {node {$F_3$}\n      child {node {$F_2$}\n        child {node {$F_1$}}\n        child {node {$F_0$}}}\n      child {node {$F_1$}}};\n\\end{tikzpicture}\n$$\n\nThe subtree rooted at $F_3$ appears twice; $F_2$ appears three times; and the\nduplication compounds with depth. The number of leaves is itself $\\Theta(F(n))$,\nand since the Fibonacci numbers grow like $\\phi^n$ (with $\\phi = (1+\\sqrt5)\u002F2\n\\approx 1.618$ the golden ratio), $\\textsc{Rec-Fib}$ runs in $\\Theta(\\phi^n)$ time:\nexponential, to compute a quantity we could write down in a fraction of a second.\n\nThe diagnosis is precise: there are only $n + 1$ _distinct_ subproblems,\n$F(0), F(1), \\dots, F(n)$, but the recursion visits them exponentially often.\n\n## The first cure: memoization (top-down)\n\nThe minimal fix keeps the recursive structure but adds a **memo**, a table that\nremembers each answer the first time we compute it. Before recursing, we check\nthe table; if the answer is there, we return it immediately.\n\n```algorithm\ncaption: $\\textsc{Memo-Fib}(n)$ — top-down with a memo table $M[0..n]$\nnumber: 2\nif $M[n]$ is defined then\n  return $M[n]$ \u002F\u002F already solved\nif $n \u003C 2$ then\n  $M[n] \\gets n$\nelse\n  $M[n] \\gets$ $\\textsc{Memo-Fib}(n-1)$ **+** $\\textsc{Memo-Fib}(n-2)$\nreturn $M[n]$\n```\n\nNow each of the $n + 1$ subproblems is solved once; every later request for it is\na single table lookup. The running time drops from exponential to $\\Theta(n)$.\nThis style, recurse as before but **cache** results, is called\n**memoization** (note: _memo_-ization, not _memorization_). It is the **top-down**\nform of dynamic programming, and it is often the easiest to write, because it is\njust the natural recursion plus a guard.[^skiena-dp]\n\nCompare the recursion tree now against the naive one above: every repeated\nsubproblem becomes a cache hit that returns at once, so the exponential tree\ncollapses to a thin spine of $n + 1$ first-time computations.\n\n$$\n% caption: Memoized $F(5)$: each distinct subproblem is computed once (solid); later\n%          requests are cache hits (grey) that return immediately, pruning the repeated\n%          subtrees.\n\\begin{tikzpicture}[\n  level distance=11mm,\n  every node\u002F.style={draw, circle, minimum size=7mm, inner sep=1pt, font=\\small},\n  hit\u002F.style={fill=black!12},\n  level 1\u002F.style={sibling distance=38mm},\n  level 2\u002F.style={sibling distance=19mm},\n  level 3\u002F.style={sibling distance=11mm}]\n  \\node {$F_5$}\n    child {node {$F_4$}\n      child {node {$F_3$}\n        child {node {$F_2$}\n          child {node {$F_1$}}\n          child {node {$F_0$}}}\n        child {node[hit] {$F_1$}}}\n      child {node[hit] {$F_2$}}}\n    child {node[hit] {$F_3$}};\n\\end{tikzpicture}\n$$\n\nThe greyed nodes ($F_3$, $F_2$, $F_1$) are the duplicates from the naive tree;\nhere they resolve in a single lookup, so the whole computation touches each of\n$F_0, \\dots, F_5$ exactly once.\n\n## The second cure: tabulation (bottom-up)\n\nIf we know in advance _which_ subproblems we need and in _what order_ their\ndependencies resolve, we can drop the recursion entirely and fill the table\ndirectly with a loop. This is **tabulation**, the **bottom-up** form.\n\n```algorithm\ncaption: $\\textsc{Tab-Fib}(n)$ — bottom-up over a table $F[0..n]$\nnumber: 3\n$F[0] \\gets 0$\n$F[1] \\gets 1$\nfor $i \\gets 2$ to $n$ do\n  $F[i] \\gets F[i-1] + F[i-2]$\nreturn $F[n]$\n```\n\nThe loop visits subproblems in an order, $0, 1, 2, \\dots, n$, that guarantees\nevery dependency is ready before it is needed. No recursion, no memo-check\noverhead, no risk of stack overflow.\n\nThe two cures fill the _same_ array; they differ only in the order they visit\nits cells. Bottom-up sweeps the indices forward; top-down dives to $F_n$ first\nand writes each cell as the recursion unwinds.\n\n$$\n% caption: Top-down and bottom-up fill the same table $F[0..5]$ in opposite orders, yet\n%          produce identical values $0,1,1,2,3,5$.\n\\begin{tikzpicture}[\n  >=Stealth,\n  cell\u002F.style={draw, minimum size=9mm, inner sep=1pt, font=\\small},\n  lbl\u002F.style={draw=none, font=\\footnotesize}]\n  \\definecolor{acc}{HTML}{2348F2}\n  \\node[lbl] at (-1.7,0) {bottom-up};\n  \\foreach \\v\u002F\\x in {0\u002F0,1\u002F1,1\u002F2,2\u002F3,3\u002F4,5\u002F5} { \\node[cell] at (\\x,0) {$\\v$}; }\n  \\foreach \\x in {0,...,5} { \\node[lbl] at (\\x,0.72) {$\\x$}; }\n  \\draw[->, thick, red!75!black] (-0.55,-0.62) -- (5.55,-0.62) node[midway, below, draw=none, font=\\footnotesize, red!75!black] {fill order $0 \\to 5$};\n  \\node[lbl] at (-1.7,-2.1) {top-down};\n  \\foreach \\v\u002F\\x in {0\u002F0,1\u002F1,1\u002F2,2\u002F3,3\u002F4,5\u002F5} { \\node[cell] at (\\x,-2.1) {$\\v$}; }\n  \\draw[->, thick, red!75!black] (5.55,-2.72) -- (-0.55,-2.72) node[midway, below, draw=none, font=\\footnotesize, red!75!black] {recurse from $5$, fill on return};\n\\end{tikzpicture}\n$$\n\n> **Remark (Top-down vs bottom-up).** Top-down and bottom-up compute _exactly the same values_ and have the _same_\n> asymptotic running time. Memoization solves only the subproblems actually\n> reachable from the top, which can be a win when many subproblems are\n> irrelevant; tabulation has lower constant-factor overhead and often exposes a\n> space optimization. For Fibonacci, since $F[i]$ depends only on the previous\n> two entries, the table can shrink to two scalars, giving $\\Theta(1)$ space.\n\n## The two conditions that make DP work\n\nDynamic programming is not a universal hammer. It applies precisely when a\nproblem has **two** structural properties, both emphasized by all three texts.\n\n**1. Overlapping subproblems.** The recursive solution revisits the same\nsubproblems repeatedly; there are only polynomially many _distinct_ ones, even\nthough the naive recursion calls them exponentially often. This is what makes\ncaching pay off. (Contrast divide-and-conquer like merge sort, where each\nrecursive call is on a _fresh_ subproblem; there is nothing to cache, so\nmemoization buys nothing.)\n\n**2. Optimal substructure.** An optimal solution to the problem is built from\noptimal solutions to its subproblems. This is what lets us write a recurrence at\nall: we can express the best answer for an instance in terms of the best answers\nfor smaller instances. CLRS states the test sharply: cut an optimal solution at\nsome choice point; the piece that remains must itself be an optimal solution to\nthe residual subproblem, or we could splice in a better piece and improve the\nwhole, a contradiction.[^clrs-dp]\n\n> **Fact (When DP applies).** When both hold, dynamic programming applies. When optimal substructure fails,\n> no recurrence over subproblems can be correct; when subproblems do not overlap,\n> plain divide-and-conquer is already efficient and DP adds only overhead.\n\n## The dynamic-programming recipe\n\nDP is a _design discipline_, not a bag of tricks. The method distils into an\nexplicit checklist, the **key steps in a DP solution**, and every example\nfollows the same order. Following it turns a moment of insight into a\nroutine you can execute.\n\n1. **Identify a simplified goal** _(maybe)_. Often the original problem asks for an\n   optimal _object_ (the actual set of cuts, the actual chosen intervals). First\n   solve the easier problem of computing only the optimal _value_; recovering the\n   object is a separate, usually short, step at the end.\n2. **Clearly define the subproblems; set up notation.** State precisely what\n   quantity $\\textsc{Opt}(\\cdot)$ denotes, in one English sentence, and which\n   call gives the final answer. This is the single hardest and most important\n   step. Get the subproblem definition right and everything else follows; get it\n   wrong and nothing will.\n3. **Write the DP equations.** Express $\\textsc{Opt}$ of a subproblem in terms of\n   $\\textsc{Opt}$ of _smaller_ subproblems, together with the base case(s). This is\n   where **optimal substructure** is used: enumerate the choices an optimal\n   solution could make at its first decision point and take the best.\n4. **Prove correctness of the equations** _(induction, usually)_. Argue by\n   induction on subproblem size that the equation computes exactly the quantity\n   the definition names.\n5. **Write the pseudocode** _(be iterative!)_. Turn the equations into a bottom-up\n   loop that fills a table in an order respecting the dependencies.\n6. **Get back to the original goal** _(maybe)_. If a simplified goal was used,\n   reconstruct the optimal object, either by storing the winning choice at each\n   entry, or by tracing back through the filled table.\n7. **Argue correctness of the pseudocode** _(usually very short)_: it faithfully\n   evaluates the equations in a valid order.\n8. **Analyze the running time.** Almost mechanical: it is the **number of\n   subproblems** times the **work per subproblem** (the time to evaluate one line\n   of the recurrence).\n\nThe rest of this lesson runs the recipe end-to-end on two opening examples:\nfirst **weighted interval scheduling**, then **rod cutting**.\n\n## A worked optimization: weighted interval scheduling\n\nFibonacci shows the speedup but hides the _optimization_ flavor that gives DP its\nreal power. The first optimization example is **weighted interval\nscheduling**, which sharpens the [greedy interval-scheduling problem](\u002Falgorithms\u002Fgreedy\u002Fthe-greedy-method) you have\nalready met: now each interval carries a profit, and we want the most profitable\ncompatible set rather than merely the most intervals.\n\n**Input.** Intervals $\\langle I_1, \\dots, I_n\\rangle$, each $I_i = (s_i, f_i)$\nwith a profit $p_i$. **Desired output.** A subset $\\set{I_{i_1}, \\dots, I_{i_k}}$\nthat is _feasible_ (the chosen intervals are pairwise disjoint) and maximizes\n$p_{i_1} + \\cdots + p_{i_k}$.\n\n**Step 1: Simplified goal.** Compute only the maximum achievable profit\n$\\textsc{Opt}(I_1, \\dots, I_n)$; we recover the actual subset afterwards.\n\n**Step 2: Subproblems and notation.** The key preprocessing move is to **sort the\nintervals by increasing finish time**, so $f_1 \\le f_2 \\le \\cdots \\le f_n$. Once\nsorted, every subproblem we ever need has the contiguous prefix form\n$\\langle I_1, \\dots, I_i\\rangle$, so a single index $i$ names it. Define\n$$\n\\textsc{Opt}(i) = \\text{max profit obtainable from intervals } \\langle I_1, \\dots, I_i\\rangle,\n$$\nand we want $\\textsc{Opt}(n)$. For each $i$ we also precompute\n$$\nq(i) = \\max\\set{\\, j : I_j \\cap I_i = \\emptyset \\text{ and } j \u003C i \\,},\n$$\nthe index of the rightmost interval _to the left of_ $I_i$ that does not overlap\n$I_i$ (and $q(i) = 0$ if none exists). Because finish times are sorted, \"$I_j$\nends before $I_i$ starts\" is exactly the test, so $q(i)$ is well defined.\n\nDrawn on a timeline, the intervals stack up by finish time, and $q(i)$ is just the\nlast bar that clears $I_i$'s left edge:\n\n$$\n% caption: Intervals sorted by finish time; $q(i)$ is the rightmost interval ending before\n%          $I_i$ starts. Here $q(6)=3$: interval $I_3$ is the last one entirely left of\n%          $I_6$.\n\\begin{tikzpicture}[\n  >=Stealth,\n  bar\u002F.style={draw, fill=acc!15, minimum height=4.5mm, inner sep=2pt, font=\\small},\n  sel\u002F.style={draw=acc, very thick, fill=acc!15, minimum height=4.5mm, inner sep=2pt, font=\\small}]\n  \\definecolor{acc}{HTML}{2348F2}\n  % I_i = [start,finish] on x, stacked on y\n  \\node[bar, minimum width=14mm] (a) at (0.9,0)   {$I_1$};\n  \\node[bar, minimum width=16mm] (b) at (2.4,-0.7){$I_2$};\n  \\node[bar, minimum width=13mm] (c) at (1.3,-1.4){$I_3$};\n  \\node[bar, minimum width=15mm] (d) at (3.4,-2.1){$I_4$};\n  \\node[bar, minimum width=14mm] (e) at (4.7,-2.8){$I_5$};\n  \\node[sel, minimum width=18mm] (f) at (4.55,-3.5){$I_6$};\n  % time axis\n  \\draw[->, thick] (-0.4,-4.2) -- (6.6,-4.2) node[right, font=\\footnotesize] {time};\n  % left edge of I_6, and the q(6)=3 pointer from I_3's finish\n  \\draw[dashed, acc] (3.75,-3.85) -- (3.75,0.35);\n  \\node[font=\\footnotesize, acc] at (3.75,0.62) {start of $I_6$};\n  \\draw[->, very thick, red!75!black] (1.95,-1.4) .. controls (2.6,-2.6) and (3.0,-3.0) .. (3.6,-3.5);\n  \\node[font=\\footnotesize, red!75!black, align=center] at (0.55,-2.7) {$q(6)=3$\\\\(last bar\\\\left of $I_6$)};\n\\end{tikzpicture}\n$$\n\n**Step 3: DP equations.** Consider the last interval $I_i$ and make one binary\nchoice — **include it or not**:\n$$\n\\textsc{Opt}(i) =\n\\begin{cases}\n0 & \\text{if } i = 0, \\\\[4pt]\n\\max\n\\begin{cases}\n\\textsc{Opt}(i-1) & \\text{\u002F\u002F without } I_i \\\\[2pt]\np_i + \\textsc{Opt}(q(i)) & \\text{\u002F\u002F with } I_i\n\\end{cases}\n& \\text{if } i \\ge 1.\n\\end{cases}\n$$\nIf we _exclude_ $I_i$, the best we can do is $\\textsc{Opt}(i-1)$. If we _include_\nit, we collect $p_i$ and may no longer use any interval that overlaps $I_i$; the\nremaining usable intervals are exactly $\\langle I_1, \\dots, I_{q(i)}\\rangle$, so we\nadd $\\textsc{Opt}(q(i))$ — optimal substructure in action.\n\n**Step 4: Correctness (sketch).** By induction on $i$. The base case\n$\\textsc{Opt}(0) = 0$ is immediate. For the step, any optimal schedule on the\nfirst $i$ intervals either omits $I_i$ (an optimal schedule on the first $i-1$, by\nthe inductive hypothesis $= \\textsc{Opt}(i-1)$) or contains $I_i$ (then the rest\nis an optimal schedule on $\\langle I_1,\\dots,I_{q(i)}\\rangle$, contributing\n$p_i + \\textsc{Opt}(q(i))$). Taking the max of the two cases is exactly the\nequation.\n\n**Step 5: Pseudocode.** Fill the table in increasing $i$, so both\n$\\textsc{Opt}[i-1]$ and $\\textsc{Opt}[q(i)]$ are ready when needed.\n\n```algorithm\ncaption: $\\textsc{Iter-IS}(I_1, \\dots, I_n)$ — max-profit interval scheduling\nnumber: 4\nsort intervals by increasing finish time $f_i$ \u002F\u002F $O(n \\log n)$\n$\\textsc{Opt}[0] \\gets 0$\nfor $i \\gets 1$ to $n$ do\n  $k \\gets q(i)$\n  $\\textsc{Opt}[i] \\gets \\max\\bigl(\\textsc{Opt}[i-1],\\ p_i + \\textsc{Opt}[k]\\bigr)$ \u002F\u002F $O(1)$ per iteration\nreturn $\\textsc{Opt}[n]$\n```\n\n**Step 8: Running time.** The sort costs $O(n \\log n)$. Each of the $n$ table\nentries does $O(1)$ work _given_ $q(i)$. The values $q(i)$ themselves can be found\nby binary search ($O(\\log n)$ each) or, since they are monotone in $i$, by a single\nlinear scan that advances across all iterations in $O(n)$ total. Either way the\nsort dominates, for a worst-case running time of\n$$\nO(n \\log n).\n$$\n\nThis is the canonical \"include-or-exclude\" DP, and its dependency structure makes\nthe overlap concrete: entry $\\textsc{Opt}(i)$ points back to its two predecessors,\n$\\textsc{Opt}(i-1)$ and $\\textsc{Opt}(q(i))$, and those arrows cross and reconverge\non shared subproblems, the same overlap that doomed naive Fibonacci.\n\n$$\n% caption: Dependency graph of interval-scheduling subproblems sharing overlapping\n%          entries.\n\\begin{tikzpicture}[\n  >=Stealth,\n  node distance=14mm,\n  every node\u002F.style={draw, circle, minimum size=8mm, inner sep=1pt, font=\\small},\n  every edge\u002F.style={draw, ->, bend left=18}]\n  \\node (o5) {$5$};\n  \\node (o4) [below left=10mm and 6mm of o5] {$4$};\n  \\node (o3) [below=of o4] {$3$};\n  \\node (o2) [right=of o3] {$2$};\n  \\node (o1) [below right=10mm and 6mm of o3] {$1$};\n  \\node (o0) [right=14mm of o1] {$0$};\n  \\path (o5) edge (o4)        % Opt(5) -> Opt(4) = Opt(i-1)\n        (o5) edge (o2)        % Opt(5) -> Opt(q(5)) = Opt(2)\n        (o4) edge (o3)        % Opt(4) -> Opt(3)\n        (o4) edge (o1)        % Opt(4) -> Opt(q(4)) = Opt(1)\n        (o3) edge (o2)        % Opt(3) -> Opt(2)\n        (o3) edge (o0)        % Opt(3) -> Opt(q(3)) = Opt(0)\n        (o2) edge (o1)        % Opt(2) -> Opt(1)\n        (o1) edge (o0);       % Opt(1) -> Opt(0)\n\\end{tikzpicture}\n$$\n\nSeveral nodes ($\\textsc{Opt}(2)$, $\\textsc{Opt}(1)$, $\\textsc{Opt}(0)$) are\npointed to more than once: those are the overlapping subproblems the table solves\njust once.\n\n**Step 6: Back to the original goal.** To recover the _actual_ set, record at each\n$i$ which branch won. In the pseudocode below, $\\textit{chosen}[i] = \\text{true}$\nmeans $I_i$ is in the optimal solution for the prefix $\\langle I_1,\\dots,I_i\\rangle$.\n\n```algorithm\ncaption: $\\textsc{Iter-IS}^{\\prime}(I_1, \\dots, I_n)$ — also reconstruct the set\nnumber: 5\nsort intervals by increasing finish time $f_i$\n$\\textsc{Opt}[0] \\gets 0$\nallocate boolean array $\\textit{chosen}[1..n]$\nfor $i \\gets 1$ to $n$ do\n  $k \\gets q(i)$\n  if $\\textsc{Opt}[i-1] \\ge p_i + \\textsc{Opt}[k]$ then\n    $\\textit{chosen}[i] \\gets \\text{false}$\n    $\\textsc{Opt}[i] \\gets \\textsc{Opt}[i-1]$\n  else\n    $\\textit{chosen}[i] \\gets \\text{true}$\n    $\\textsc{Opt}[i] \\gets p_i + \\textsc{Opt}[k]$\nreturn $\\textsc{Opt}[n],\\ \\textit{chosen}$\n```\n\nTrace back from $i = n$: if $\\textit{chosen}[i]$, output $I_i$ and jump to $q(i)$;\notherwise step to $i - 1$. This walk recovers an optimal set in $O(n)$.\n\n## A second worked optimization: rod cutting\n\nThe same recipe applied to **rod cutting** (CLRS's opening case) shows a different\nflavor of choice — not binary, but \"try every first piece.\" Given a rod of integer\nlength $n$ and a price $p_i$ for a piece of length $i$, cut the rod into integer\npieces to maximize total revenue. With the price table\n\n| length $i$ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |\n|---|---|---|---|---|---|---|---|---|---|---|\n| price $p_i$ | 1 | 5 | 8 | 9 | 10 | 17 | 17 | 20 | 24 | 30 |\n\na rod of length $n = 8$ sells whole for $20$, but cutting it as $6 + 2$ earns\n$17 + 5 = 22$ — so the cuts matter.\n\n**Simplified goal.** Find just the maximum obtainable revenue. **Subproblem.** Let\n$\\textsc{Opt}(i)$ be the max revenue from a rod of length $i$; we want\n$\\textsc{Opt}(n)$. **DP equations.** Consider the _rightmost_ cut. If the rightmost\npiece has length $j$ (for some $1 \\le j \\le i$), we earn $p_j$ and cut the\nremaining length $i - j$ optimally — optimal substructure. We do not know the best\n$j$, so we try them all:\n$$\n\\textsc{Opt}(i) =\n\\begin{cases}\n0 & \\text{if } i = 0, \\\\[2pt]\n\\max\\limits_{1 \\le j \\le i}\\bigl(p_j + \\textsc{Opt}(i-j)\\bigr) & \\text{if } i \\ge 1.\n\\end{cases}\n$$\nThe subproblems $\\textsc{Opt}(0), \\dots, \\textsc{Opt}(n)$ are ordered by length, so\nwe fill them in increasing order.\n\n```algorithm\ncaption: $\\textsc{Cut-Rod}(p[1..n])$ — maximum revenue cutting a length-$n$ rod\nnumber: 6\n$\\textsc{Opt}[0..n] \\gets 0$\nfor $i \\gets 1$ to $n$ do\n  for $j \\gets 1$ to $i$ do\n    $\\textsc{Opt}[i] \\gets \\max\\bigl(\\textsc{Opt}[i],\\ p[j] + \\textsc{Opt}[i-j]\\bigr)$ \u002F\u002F rightmost piece length $j$\nreturn $\\textsc{Opt}[n]$\n```\n\n**Running time.** There are $n$ subproblems, and the work to compute\n$\\textsc{Opt}[i]$ is at most $b\\,i$ for a constant $b$ (the inner loop runs $i$\ntimes). Summing,\n$$\nT(n) = O(n) + \\sum_{i=1}^{n} b\\,i = O(n) + b\\cdot\\frac{n(n+1)}{2} = O(n^2),\n$$\na polynomial replacement for the $\\Theta(2^{n-1})$ ways to cut the rod that a naive\nrecursion would explore. To recover the cuts, store the winning length $j$ in a\nsecond array $\\textit{rightmost}[i]$, then read them off by following\n$n \\to n - \\textit{rightmost}[n] \\to \\cdots \\to 0$.\n\n```algorithm\ncaption: $\\textsc{Print-Cut-Rod}(p[1..n])$ — print an optimal set of cuts\nnumber: 7\n$\\textit{opt}, \\textit{rightmost} \\gets \\textsc{Cut-Rod}^{\\prime}(p)$ \u002F\u002F also returns cut lengths\nwhile $n > 0$ do\n  print $\\textit{rightmost}[n]$\n  $n \\gets n - \\textit{rightmost}[n]$\n```\n\n## Takeaways\n\n- **Dynamic programming is recursion without repetition**: find a recursive\n  structure, then solve each distinct subproblem once and store the result.\n- It applies exactly when the problem has **overlapping subproblems** (so caching\n  helps) and **optimal substructure** (so a recurrence over subproblems is\n  correct).\n- **Memoization** (top-down) caches results inside the natural recursion;\n  **tabulation** (bottom-up) fills the table with a loop in dependency order. Same\n  values, same time; tabulation often saves space.\n- The **DP recipe** develops every dynamic program systematically:\n  simplified goal → define subproblems\u002Fnotation → DP equations → prove correctness\n  by induction → iterative pseudocode → recover the original object → runtime.\n- The hardest step is **defining the subproblem**; a smart preprocessing choice can\n  make it cheap: sorting intervals by finish time reduces every subproblem to a\n  prefix named by one index.\n- Running time $=$ (**number of subproblems**) $\\times$ (**work per subproblem**):\n  Fibonacci becomes $\\Theta(n)$, weighted interval scheduling $O(n\\log n)$, rod\n  cutting $\\Theta(n^2)$.\n\n[^erickson-dp]: **Erickson**, Ch. 3 — Dynamic Programming: the working definition of dynamic programming as \"recursion without repetition.\"\n[^skiena-dp]: **Skiena**, §10 — Dynamic Programming: top-down memoization as caching results inside the natural recursion.\n[^clrs-dp]: **CLRS**, Ch. 15 — Dynamic Programming: the optimal-substructure cut-and-paste test for a correct recurrence.\n",{"text":10788,"minutes":10789,"time":10790,"words":10791},"12 min read",11.205,672300,2241,{"title":235,"description":10763},[10794,10796,10798],{"book":10741,"ref":10795},"Ch. 15 — Dynamic Programming",{"book":10729,"ref":10797},"§10 — Dynamic Programming",{"book":10712,"ref":10799},"Ch. 3 — Dynamic Programming","available","01.algorithms\u002F08.dynamic-programming\u002F01.principles",[231,26],"PFUkfMaDVOuyS09pAhmtbXulxIrmux9dPeOhoQuGG4w",{"\u002Falgorithms\u002Ffoundations\u002Fwhat-is-an-algorithm":10805,"\u002Falgorithms\u002Ffoundations\u002Fasymptotic-analysis":10806,"\u002Falgorithms\u002Ffoundations\u002Frecurrences":10807,"\u002Falgorithms\u002Fdivide-and-conquer\u002Fmergesort":10808,"\u002Falgorithms\u002Fdivide-and-conquer\u002Fquicksort":10809,"\u002Falgorithms\u002Fdivide-and-conquer\u002Fselection":10810,"\u002Falgorithms\u002Fsorting\u002Fheaps-and-heapsort":10811,"\u002Falgorithms\u002Fsorting\u002Fsorting-lower-bounds":10812,"\u002Falgorithms\u002Fsorting\u002Flinear-time-sorting":10813,"\u002Falgorithms\u002Fdata-structures\u002Felementary-structures":10814,"\u002Falgorithms\u002Fdata-structures\u002Fhash-tables":10815,"\u002Falgorithms\u002Fdata-structures\u002Fbinary-search-trees":10816,"\u002Falgorithms\u002Fdata-structures\u002Favl-trees":10817,"\u002Falgorithms\u002Fdata-structures\u002Fbalanced-trees":10818,"\u002Falgorithms\u002Fdata-structures\u002Funion-find":10819,"\u002Falgorithms\u002Fdata-structures\u002Ffenwick-and-segment-trees":10820,"\u002Falgorithms\u002Fsequences\u002Ftwo-pointers-and-windows":10821,"\u002Falgorithms\u002Fsequences\u002Fmonotonic-stacks":10822,"\u002Falgorithms\u002Fsequences\u002Fbinary-search-on-the-answer":10823,"\u002Falgorithms\u002Fsequences\u002Fstring-matching":10824,"\u002Falgorithms\u002Fsequences\u002Ftries":10825,"\u002Falgorithms\u002Fgraphs\u002Frepresentations-and-traversal":10826,"\u002Falgorithms\u002Fgraphs\u002Ftopological-sort-and-scc":10827,"\u002Falgorithms\u002Fgraphs\u002Fminimum-spanning-trees":10828,"\u002Falgorithms\u002Fgraphs\u002Fshortest-paths":10829,"\u002Falgorithms\u002Fgraphs\u002Fnetwork-flow":10830,"\u002Falgorithms\u002Fgraphs\u002Fbridges-and-articulation-points":10831,"\u002Falgorithms\u002Fgraphs\u002Flowest-common-ancestor":10832,"\u002Falgorithms\u002Fgraphs\u002Ftwo-sat":10833,"\u002Falgorithms\u002Fgraphs\u002Feulerian-tours":10834,"\u002Falgorithms\u002Fgreedy\u002Fthe-greedy-method":10835,"\u002Falgorithms\u002Fgreedy\u002Fscheduling-and-intervals":10836,"\u002Falgorithms\u002Fgreedy\u002Fhuffman-codes":10837,"\u002Falgorithms\u002Fgreedy\u002Fmatroids":10838,"\u002Falgorithms\u002Fdynamic-programming\u002Fprinciples":10791,"\u002Falgorithms\u002Fdynamic-programming\u002Fsequence-dp":10839,"\u002Falgorithms\u002Fdynamic-programming\u002Flongest-increasing-subsequence":10840,"\u002Falgorithms\u002Fdynamic-programming\u002Fknapsack":10841,"\u002Falgorithms\u002Fdynamic-programming\u002Fcoin-change-and-unbounded":10842,"\u002Falgorithms\u002Fdynamic-programming\u002Finterval-dp":10843,"\u002Falgorithms\u002Fdynamic-programming\u002Ftree-dp":10844,"\u002Falgorithms\u002Fdynamic-programming\u002Fbitmask-dp":10845,"\u002Falgorithms\u002Fdynamic-programming\u002Fdp-optimizations":10846,"\u002Falgorithms\u002Fdynamic-programming\u002Fdp-on-graphs":10847,"\u002Falgorithms\u002Fbacktracking\u002Fbacktracking-fundamentals":10848,"\u002Falgorithms\u002Fbacktracking\u002Fconstraint-search":10849,"\u002Falgorithms\u002Fbacktracking\u002Fbranch-and-bound":10850,"\u002Falgorithms\u002Fmathematical-algorithms\u002Fnumber-theory-basics":10821,"\u002Falgorithms\u002Fmathematical-algorithms\u002Fmodular-exponentiation-and-primality":10851,"\u002Falgorithms\u002Fmathematical-algorithms\u002Fsieve-and-factorization":10852,"\u002Falgorithms\u002Fmathematical-algorithms\u002Fcombinatorics":10853,"\u002Falgorithms\u002Fcomputational-geometry\u002Fgeometric-primitives":10854,"\u002Falgorithms\u002Fcomputational-geometry\u002Fconvex-hull":10837,"\u002Falgorithms\u002Fcomputational-geometry\u002Fsweep-line":10855,"\u002Falgorithms\u002Fintractability\u002Fp-np-reductions":10856,"\u002Falgorithms\u002Fintractability\u002Fnp-completeness":10817,"\u002Falgorithms\u002Fintractability\u002Fcoping-with-hardness":10857,"\u002Falgorithms":10858,"\u002Ftheory-of-computation":10859,"\u002Fcomputer-architecture":10859,"\u002Fphysical-computing":10859,"\u002Fdatabases":10859,"\u002Fdeep-learning":10859},1763,2107,1738,2628,1723,2048,1697,1044,1542,1565,1679,1586,1388,1465,1971,1455,1533,1483,1578,1791,1481,2704,1658,2070,1978,2080,1568,1451,1291,1543,1883,1443,1599,2038,1744,1678,2288,1929,1657,1412,1554,1418,1713,1798,1694,1762,1534,1595,1262,1495,1630,2306,2142,107,0,{"\u002Falgorithms\u002Ffoundations\u002Fwhat-is-an-algorithm":10861,"\u002Falgorithms\u002Ffoundations\u002Fasymptotic-analysis":10862,"\u002Falgorithms\u002Ffoundations\u002Frecurrences":10863,"\u002Falgorithms\u002Fdivide-and-conquer\u002Fmergesort":10864,"\u002Falgorithms\u002Fdivide-and-conquer\u002Fquicksort":10865,"\u002Falgorithms\u002Fdivide-and-conquer\u002Fselection":10866,"\u002Falgorithms\u002Fsorting\u002Fheaps-and-heapsort":10867,"\u002Falgorithms\u002Fsorting\u002Fsorting-lower-bounds":10868,"\u002Falgorithms\u002Fsorting\u002Flinear-time-sorting":10869,"\u002Falgorithms\u002Fdata-structures\u002Felementary-structures":10870,"\u002Falgorithms\u002Fdata-structures\u002Fhash-tables":10871,"\u002Falgorithms\u002Fdata-structures\u002Fbinary-search-trees":10872,"\u002Falgorithms\u002Fdata-structures\u002Favl-trees":10873,"\u002Falgorithms\u002Fdata-structures\u002Fbalanced-trees":10874,"\u002Falgorithms\u002Fdata-structures\u002Funion-find":10875,"\u002Falgorithms\u002Fdata-structures\u002Ffenwick-and-segment-trees":10876,"\u002Falgorithms\u002Fsequences\u002Ftwo-pointers-and-windows":10877,"\u002Falgorithms\u002Fsequences\u002Fmonotonic-stacks":10878,"\u002Falgorithms\u002Fsequences\u002Fbinary-search-on-the-answer":10879,"\u002Falgorithms\u002Fsequences\u002Fstring-matching":10880,"\u002Falgorithms\u002Fsequences\u002Ftries":10881,"\u002Falgorithms\u002Fgraphs\u002Frepresentations-and-traversal":10882,"\u002Falgorithms\u002Fgraphs\u002Ftopological-sort-and-scc":10883,"\u002Falgorithms\u002Fgraphs\u002Fminimum-spanning-trees":10884,"\u002Falgorithms\u002Fgraphs\u002Fshortest-paths":10885,"\u002Falgorithms\u002Fgraphs\u002Fnetwork-flow":10886,"\u002Falgorithms\u002Fgraphs\u002Fbridges-and-articulation-points":10887,"\u002Falgorithms\u002Fgraphs\u002Flowest-common-ancestor":10888,"\u002Falgorithms\u002Fgraphs\u002Ftwo-sat":10889,"\u002Falgorithms\u002Fgraphs\u002Feulerian-tours":10890,"\u002Falgorithms\u002Fgreedy\u002Fthe-greedy-method":10891,"\u002Falgorithms\u002Fgreedy\u002Fscheduling-and-intervals":10892,"\u002Falgorithms\u002Fgreedy\u002Fhuffman-codes":10893,"\u002Falgorithms\u002Fgreedy\u002Fmatroids":10894,"\u002Falgorithms\u002Fdynamic-programming\u002Fprinciples":10895,"\u002Falgorithms\u002Fdynamic-programming\u002Fsequence-dp":10896,"\u002Falgorithms\u002Fdynamic-programming\u002Flongest-increasing-subsequence":10897,"\u002Falgorithms\u002Fdynamic-programming\u002Fknapsack":10898,"\u002Falgorithms\u002Fdynamic-programming\u002Fcoin-change-and-unbounded":10899,"\u002Falgorithms\u002Fdynamic-programming\u002Finterval-dp":10900,"\u002Falgorithms\u002Fdynamic-programming\u002Ftree-dp":10901,"\u002Falgorithms\u002Fdynamic-programming\u002Fbitmask-dp":10902,"\u002Falgorithms\u002Fdynamic-programming\u002Fdp-optimizations":10903,"\u002Falgorithms\u002Fdynamic-programming\u002Fdp-on-graphs":10904,"\u002Falgorithms\u002Fbacktracking\u002Fbacktracking-fundamentals":10905,"\u002Falgorithms\u002Fbacktracking\u002Fconstraint-search":10906,"\u002Falgorithms\u002Fbacktracking\u002Fbranch-and-bound":10907,"\u002Falgorithms\u002Fmathematical-algorithms\u002Fnumber-theory-basics":10908,"\u002Falgorithms\u002Fmathematical-algorithms\u002Fmodular-exponentiation-and-primality":10909,"\u002Falgorithms\u002Fmathematical-algorithms\u002Fsieve-and-factorization":10910,"\u002Falgorithms\u002Fmathematical-algorithms\u002Fcombinatorics":10911,"\u002Falgorithms\u002Fcomputational-geometry\u002Fgeometric-primitives":10912,"\u002Falgorithms\u002Fcomputational-geometry\u002Fconvex-hull":10913,"\u002Falgorithms\u002Fcomputational-geometry\u002Fsweep-line":10914,"\u002Falgorithms\u002Fintractability\u002Fp-np-reductions":10915,"\u002Falgorithms\u002Fintractability\u002Fnp-completeness":10916,"\u002Falgorithms\u002Fintractability\u002Fcoping-with-hardness":10917,"\u002Falgorithms":10918,"\u002Ftheory-of-computation":10921,"\u002Fcomputer-architecture":10924,"\u002Fphysical-computing":10927,"\u002Fdatabases":10930,"\u002Fdeep-learning":10933},{"path":11,"title":10,"module":5,"summary":14},{"path":17,"title":16,"module":5,"summary":20},{"path":23,"title":22,"module":5,"summary":27},{"path":34,"title":33,"module":29,"summary":37},{"path":40,"title":39,"module":29,"summary":43},{"path":46,"title":45,"module":29,"summary":49},{"path":56,"title":55,"module":51,"summary":59},{"path":62,"title":61,"module":51,"summary":64},{"path":67,"title":66,"module":51,"summary":70},{"path":78,"title":77,"module":72,"summary":81},{"path":84,"title":83,"module":72,"summary":87},{"path":90,"title":89,"module":72,"summary":92},{"path":95,"title":94,"module":72,"summary":98},{"path":101,"title":100,"module":72,"summary":104},{"path":107,"title":106,"module":72,"summary":112},{"path":115,"title":114,"module":72,"summary":119},{"path":126,"title":125,"module":121,"summary":129},{"path":132,"title":131,"module":121,"summary":134},{"path":137,"title":136,"module":121,"summary":140},{"path":143,"title":142,"module":121,"summary":146},{"path":149,"title":148,"module":121,"summary":151},{"path":158,"title":157,"module":153,"summary":162},{"path":165,"title":164,"module":153,"summary":167},{"path":170,"title":169,"module":153,"summary":172},{"path":175,"title":174,"module":153,"summary":177},{"path":180,"title":179,"module":153,"summary":182},{"path":185,"title":184,"module":153,"summary":187},{"path":190,"title":189,"module":153,"summary":192},{"path":195,"title":194,"module":153,"summary":198},{"path":201,"title":200,"module":153,"summary":204},{"path":211,"title":210,"module":206,"summary":213},{"path":216,"title":215,"module":206,"summary":219},{"path":222,"title":221,"module":206,"summary":224},{"path":227,"title":226,"module":206,"summary":229},{"path":236,"title":235,"module":231,"summary":238},{"path":241,"title":240,"module":231,"summary":244},{"path":247,"title":246,"module":231,"summary":249},{"path":252,"title":251,"module":231,"summary":254},{"path":257,"title":256,"module":231,"summary":259},{"path":262,"title":261,"module":231,"summary":264},{"path":267,"title":266,"module":231,"summary":269},{"path":272,"title":271,"module":231,"summary":274},{"path":277,"title":276,"module":231,"summary":279},{"path":282,"title":281,"module":231,"summary":285},{"path":292,"title":291,"module":287,"summary":295},{"path":298,"title":297,"module":287,"summary":300},{"path":303,"title":302,"module":287,"summary":305},{"path":312,"title":311,"module":307,"summary":315},{"path":318,"title":317,"module":307,"summary":320},{"path":323,"title":322,"module":307,"summary":325},{"path":328,"title":327,"module":307,"summary":330},{"path":338,"title":337,"module":332,"summary":341},{"path":344,"title":343,"module":332,"summary":346},{"path":349,"title":348,"module":332,"summary":351},{"path":359,"title":358,"module":353,"summary":362},{"path":364,"title":361,"module":353,"summary":366},{"path":369,"title":368,"module":353,"summary":373},{"path":10919,"title":10920,"module":376,"summary":376},"\u002Falgorithms","Algorithms",{"path":10922,"title":10923,"module":376,"summary":376},"\u002Ftheory-of-computation","Theory of Computation",{"path":10925,"title":10926,"module":376,"summary":376},"\u002Fcomputer-architecture","Computer Architecture",{"path":10928,"title":10929,"module":376,"summary":376},"\u002Fphysical-computing","Physical Computing",{"path":10931,"title":10932,"module":376,"summary":376},"\u002Fdatabases","Databases",{"path":10934,"title":10935,"module":376,"summary":376},"\u002Fdeep-learning","Deep Learning",1781560525399]