#include <iostream>
using namespace std
;
typedef struct point
{
long x
, y
;
};
int main()
{
long n
, a
, b
;
cin
>> n
>> a
>> b
;
point
*p1
= new point
[a
+1];
for (long i
= 1; i
<= a
; i
++)
{
cin
>> p1
[i
].x
>> p1
[i
].y
;
}
long x
,y
;
long long sum
= 0;
long j
= 1;
for (long i
= 1; i
<= b
; i
++)
{
cin
>> x
>> y
;
while (j
<= a
)
{
if (p1
[j
].x
> x
)
{
break;
}
else if (p1
[j
].x
< x
)
{
j
++;
}
else
{
sum
+= y
* p1
[j
].y
;
break;
}
if (j
> a
)
{
break;
}
}
}
cout
<< sum
;
return 0;
}
转载请注明原文地址:https://tech.qufami.com/read-7258.html