{"problem":{"name":"E. Subrect Query","description":{"content":"De Prezer loves rectangles.He has a n × m rectangle which there is a number in each of its cells. We show the number in the j - th column of the i - th row by ai, j. De Prezer also loves query. So he","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":8000,"memory_limit":524288},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10057E"},"statements":[{"statement_type":"Markdown","content":"De Prezer loves rectangles.He has a n × m rectangle which there is a number in each of its cells. We show the number in the j - th column of the i - th row by ai, j.\n\nDe Prezer also loves query. So he gives you q queries. In each query, he gives you number k and asks you to print the number of subrectangles of this rectangle that the difference between the maximum element and the minimum element in them is at most k .\n\nThe first line of input contains 3 integers, n, m and q .\n\nIn the next n lines, there are informations of the rectangle. i - th line among them, contains m space separated integers, ai, 1, ai, 2, ..., ai, m .\n\nThe next q lines, each line contains a single integer k (for that query).\n\n1 ≤ n, m ≤ 400\n\n1 ≤ q ≤ 10\n\n1 ≤ ai, j ≤ 109 (for each 1 ≤ i ≤ n and 1 ≤ j ≤ m)\n\n0 ≤ k ≤ 109 (for each query)\n\nFor each query, print the answer in a single line.\n\n## Input\n\nThe first line of input contains 3 integers, n, m and q .In the next n lines, there are informations of the rectangle. i - th line among them, contains m space separated integers, ai, 1, ai, 2, ..., ai, m .The next q lines, each line contains a single integer k (for that query).1 ≤ n, m ≤ 4001 ≤ q ≤ 101 ≤ ai, j ≤ 109 (for each 1 ≤ i ≤ n and 1 ≤ j ≤ m)0 ≤ k ≤ 109 (for each query)\n\n## Output\n\nFor each query, print the answer in a single line.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"Let $ n \\in \\mathbb{Z} $ with $ 1 \\leq n \\leq 10^5 $.  \nLet $ n = p_1^{e_1} p_2^{e_2} \\cdots p_k^{e_k} $ be the prime factorization of $ n $, where $ p_1 < p_2 < \\cdots < p_k $ are distinct primes and $ e_i \\geq 1 $.  \n\n**Objective**:  \nCompute $ \\sum_{i=1}^k p_i $, the sum of the distinct prime factors of $ n $, and store it in the first storage.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10057E","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}