Cho bảng giao dịch: shop, qty, price. Dùng named aggregation tính: total_qty = sum(qty), avg_price = mean(price), revenue = sum(qtyprice). Lưu ý: revenue phải tính bằng cách tạo cột revenue_row = qtyprice trước, rồi sum. In sắp theo shop: shop total_qty avg_price revenue (qty là int, còn lại float 2 chữ số).
Dòng 1: n. n dòng: shop qty(int) price(float).
1 <= n <= 1000.
shop total_qty avg_price revenue.
Ví dụ:
Đầu vào:
4
A 2 10.0
A 3 20.0
B 1 5.0
B 4 15.0
Đầu ra:
A 5 15.00 80.00
B 5 10.00 65.00
Giải thích:
Đang tải editor...