Company: Texas
Difficulty: medium
Final Discounted Price For each item, subtract the price of the first item to its right whose price is less than or equal to the current price. If no such item exists, the item is bought at full price. Print the total final cost, then the 0-based indices bought at full price in increasing order. Input Format The first line contains `n`; the next `n` lines contain one price each. Output Format Print the total on the first line and the full-price indices, separated by spaces, on the second line. Constraints `1 <= n <= 10^5`, `1 <= price <= 10^6`.