Answer the question
In order to leave comments, you need to log in
How are these types of problems solved?
I can not solve this problem, help me out, tell me how to solve it. Just details please.
To encrypt a text of m letters, choose a square matrix of order n, (n^2) > m and fill it in lines with plain text, and then transform it according to some rule so that the ciphertext is obtained from the phrase "love informatics" written as a matrix , represented as a one-dimensional array B = |toikrulimuanyubfl| . Encrypt arbitrary text in the specified way, using the algorithm below, into which you need to insert the values of unknown indices of array A.
p:=0;
нц для i от 1 до n
нц для j от 1 до i
p:=p+1; r:=mod(i,2); d:=mod(r+1,2);
B[p]:=A[d*Q+r*V, d*W+r*Z];
кц;
кц;
Answer the question
In order to leave comments, you need to log in
It can be on a piece of paper, you can write a thread. Since the answer is known, I will share my vision of the solution. In Algorithm 4, the unknowns Q, V, W, Z are [d*Q+r*V, d*W+r*Z]; To get array B, you need to make a selection from A with dimensions n [n,1] [(n-1),1] [n,2] [n,3] [n(-1),2] [(n-2) ,1] [(n-3),1] [(n-2),2] [(n-1),3] (if I didn't typo, the selection snakes diagonally) 2 loops iterate over i and j + a sign of an even and odd line (2pcs) and using these 4 values, you need to compose Q, V, W, Z in such a way that the sampling order matches. Next, substitute the found values \u200b\u200binto this formula (2Q + W) (V + 2Z) and compare the answer.
But I don’t understand one thing, the above algorithm does not allow you to completely encode array A.
Mb a typo in the condition
nc for j from 1 to i
I don’t know if this will help you, but here I tried to solve something using an example. The result is displayed in the browser console (F12 -> Console). The result was an excessive system of equations, from where you can find Q, W, V, Z (as I understand it, X, Y, G, S is for another option, or what is it in general?).
And what is this task anyway? Olympic? Do you need access to a computer for a solution or on a piece of paper?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question