human
Queries to calculate sum of array elements present at every Yth index starting from the index X | Function to Find the sum of arr [ x ] + arr [ x + y ] + arr [ x + 2 * y ] + ... for all queries.
Iterate over each query.
Stores the sum of arr [ x ] + arr [ x + y ] + arr [ x + 2 * y ] + ....
Traverse the array and calculate the sum of the expression.
Update sum.
Update x.
Driver Code"
Solution in Python:

=====
Can you provide a code to queries to calculate sum of array elements present at every Yth index starting from the index X and the other steps required?
assistant
#Here is code to queries to calculate sum of array elements present at every Yth index starting from the index X and the other steps required.
 def querySum ( arr , N , Q , M ) :
	for i in range ( M ) :
		x = Q [ i ] [ 0 ]
		y = Q [ i ] [ 1 ]
		sum = 0
		while ( x < N ) :
			sum += arr [ x ]
			x += y
		print ( sum , end = " ▁ " )
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 , 7 , 5 , 4 ] ;
	Q = [ [ 2 , 1 ] , [ 3 , 2 ] ]
	N = len ( arr )
	M = len ( Q )
	querySum ( arr , N , Q , M )