Algorithm data structure segtree lazy segtree dp lis geometry convex hull intersection graph bellman ford dijkstra floyd warshall mst lca number theory repeated squaring extended euclidean algorithm combination miller rabin