{"raw_statement":[{"iden":"statement","content":"See PDF statement in attachment.\n\n"},{"iden":"examples","content":"Input345 0-45 00 90Output0.269064434316Input60 900 1800 -9080 -9080 18080 90Output0.389591701512Input3-85 0-85 1790 90Output0.207400294880"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of nodes.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a permutation of $ \\{1, 2, \\dots, n\\} $, where $ a_i $ denotes the parent of node $ i $ (with $ a_i = i $ indicating a root).\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 2 \\times 10^6 $  \n2. $ a_i \\in \\{1, 2, \\dots, n\\} $ for all $ i \\in \\{1, \\dots, n\\} $  \n3. All $ a_i $ are distinct.\n\n**Objective**  \nCompute the number of roots in the forest, i.e., the number of nodes $ i $ such that $ a_i = i $.","simple_statement":"You are given n distinct integers from 1 to n. Each number represents a node. A node with value i becomes the child of the node with value p, where p is the largest number less than i. If no such p exists, it becomes a root. Count how many roots there are.","has_page_source":false}