We want you to write a program to show the electron arrangement of elements by receiving…
- User
We want you to write a program to show the electron arrangement of elements by receiving their names.
According to this theory, electrons are located in a number of "layers", each "layer" consists of a number of "sublayers", each of which has the capacity of a number of electrons. We have 4 types of substrates that we show with the letters s, p, d and f. The capacity of these layers is 2, 6, 10 and 14 electrons respectively. Each "layer" consists of a number of "sublayers":
first layer ( n
1 n = 1). A substrate of s. second layer ( n
2 n = 2). An s substrate and a p substrate. third layer n
3 n = 3). An s substrate, a p substrate and a d substrate. 4th layer onwards n ≥ 3 n≥3). An s substrate, a p substrate, a d substrate and an f substrate. Now we can show the layer and sub-layers as a string with two characters. For example, 3p means p-type substrate in the third layer.
If an atom of e e electron is formed in the following order, one by one it is added to the substrates until its capacity is filled and then it goes to the next substrate.
Description of the image
In these atoms, Cu, Cr, Nb, Mo, Ru, Rh, Pd, Ag, La, Ce, Gd, Pt, Au, Ac, Th, Pa, U, Np, Cm and Lr are exceptions and follow the said rules. they don't You can see their electron configuration here.
input In the first line of the input, the integer t t is given. 1 ≤ t ≤ 10 1≤t≤10 in t t the next line, in each line, the name of an element is given as a string of lower and upper case English letters, the first letter is uppercase and the other letters are lowercase. It is guaranteed that the name of this element is present in the first 104 elements of the periodic table.
output output t t has rows and in each row, print the atom sublayers as in the examples.
Example Sample entry 1 2 Mg Cu Plain text Sample output 1 1s2 2s2 2p6 3s2 1s2 2s2 2p6 3s2 3p6 3d10 4s1
- Assistant
- User
c++
- Assistant
- User
variable input
- Assistant
- User
Ashmuz, who follows with his new rights n n members a 1 , a 2 , … , a n , a 1 , a 2 ,...,a n , has bought integers, eagerly showed his sequence to Keshi. But Keshi told Ashmuz in a counter-move that the number of 42 sequences is small! So they decided to change the sequence by performing some operations so that the number of 42s will increase.
They can perform the following operations:
In each operation, Ashmes can choose a prefix from the sequence and subtract one unit from it. In each operation, the draw can select an extension of the sequence and subtract one unit from it. Description of the image
In this question, you should help Ashmuz and Kashi and calculate the maximum possible number of repetitions of 42 by taking the input of the initial sequence.
- Assistant