CF348C Subset Sums

Description

You are given an array $ a_{1},a_{2},...,a_{n} $ and $ m $ sets $ S_{1},S_{2},...,S_{m} $ of indices of elements of this array. Let's denote $ S_{k}={S_{k,i}} (1

Input Format

The first line contains integers $ n,m,q $ $ (1

Output Format

After each first type query print the required sum on a single line. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.