Fişierul intrare/ieşire:abp.in, abp.outSursăIIOT 2021-22 Runda 1
AutorIoan PopescuAdăugată destefdascalescuStefan Dascalescu stefdascalescu
Timp execuţie pe test0.75 secLimită de memorie262144 kbytes
Scorul tăuN/ADificultateN/A

Vezi solutiile trimise | Statistici

Another Boring Problem

You are given an array a of length n. You need to process q queries. Each query is one of the following two types:

1. x - What is the value of a[x] modulo 10^9+7?

2. x, y, b, c - For every i in the range [x,y] a[i] becomes max(a[i], b*i^c)

Date de intrare

The first line of the input file abp.in contains the integer n, the length of the array.

The second line of the input contains n integers, the i-th being a[i]

The third line of the input contains an integer q, the number of queries.

Each of the following q lines contains a query of one of two aforementioned types.

Date de ieşire

The output file abp.out will contain the answers to queries of type 1 on the order they appear in the input.

Restricţii

  • 1 ≤ x, y ≤ n ≤ 10^5
  • 1 ≤ q ≤ 2 * 10^5
  • 1 ≤ a[i], b, c ≤ 10^5
  • The scores obtained now may be different compared to the ones from the original contest

Exemplu

abp.inabp.out
10
5 3 7 8 3 9 10 10 1 2
15
1 7
2 1 5 3 3
1 5
1 4
1 1
2 6 10 2 2
1 6
1 7
1 10
2 1 10 10 10
1 1
1 2
1 10
1 7
1 3
10
375
192
5
72
98
200
10
10240
999999307
824752476
590490

Explicaţie

...

Trebuie sa te autentifici pentru a trimite solutii. Click aici

Cum se trimit solutii?