Submission #1210356


Source Code Expand

Copy
n, m = map(int, input().split())
mod = 10**9 + 7
X = [int(i) for i in input().split()]
Y = [int(i) for i in input().split()]
ans = 0
for i in range(n):
	ans += X[i]*(n-2*i-1)%mod
t = 0
for j in range(m):
	t += Y[j]*(m-2*j-1)%mod
ans *= t%mod
print(ans%mod)

Submission Info

Submission Time
Task D - 井井井 / ###
User TAB
Language Python3 (3.4.3)
Score 500
Code Size 267 Byte
Status
Exec Time 156 ms
Memory 19648 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_000.txt, 0_001.txt
All 500 / 500 0_000.txt, 0_001.txt, max.txt, min.txt, mod.txt, n2.txt, rndA.txt, rndB.txt, rndC.txt, rndD.txt, rndE.txt, rndF.txt, rndG.txt, rndH.txt, rndI.txt, rndJ.txt, var.txt
Case Name Status Exec Time Memory
0_000.txt 17 ms 3064 KB
0_001.txt 17 ms 3064 KB
max.txt 149 ms 19648 KB
min.txt 17 ms 3060 KB
mod.txt 83 ms 14468 KB
n2.txt 82 ms 14208 KB
rndA.txt 156 ms 18356 KB
rndB.txt 156 ms 19452 KB
rndC.txt 151 ms 18556 KB
rndD.txt 153 ms 18356 KB
rndE.txt 150 ms 18556 KB
rndF.txt 147 ms 18556 KB
rndG.txt 147 ms 18556 KB
rndH.txt 151 ms 18356 KB
rndI.txt 151 ms 18556 KB
rndJ.txt 153 ms 18556 KB
var.txt 147 ms 19472 KB