Submit solution
Points:
1.00 (partial)
Time limit:
1.0s
Memory limit:
256M
Input:
stdin
Output:
stdout
Problem type
Allowed languages
Python, Scratch
Có ~N~ hàng gạch, hàng đầu tiên có ~A~ viên gạch. Biết hàng sau hơn hàng trước ~B~ viên. Hỏi để xếp được ~N~ hàng gạch đó người ta đã dùng bao nhiêu viên gạch?
Input Specification
- Dòng 1 chứa số nguyên ~N~ ~(1 \le N \le 10^{9})~
- Dòng 2 chứa số nguyên ~A~ ~(1 \le A \le 20)~
- Dòng 3 chứa số nguyên ~B~ ~(1 \le B \le 20)~
Output Specification
Một dòng chứa kết quả bài toán
Sample Input
5
1
1
Sample Output
15
Comments
n = int(input()) a = int(input()) b = int(input()) sc = a + (n-1)b s = (a+sc)n//2 print(s) phan test
khanhhung32014 đã bình luận 3:11:42 ch, 19/04/2025 làm sai rồi
code cho các bạn tham khảo nhé!!!
def viengach(n,a,b):
n = int(input())
a = int(input())
b = int(input())
print(viengach(n,a,b))
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
Ủa, thì sao chứ?
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
ê , cho mình xin cái code đi