Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7002 - Гурвалжин

Өгөгдсөн гурвалжны периметрийг ол.

Input

Гурвалжны талууд бүхэл тоогоор нэг мөрөнд зайгаар тусгаарлагдан өгөгдөнө.

Output

Гурвалжны периметр.

Example

Input:
3 4 5

Output:
12


Нэмсэн:Bataa
Огноо:2011-01-15
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2024-06-04 12:31:58
https://s.team/p/gfqp-bppp/drdpctmb O.erkh
2024-06-03 06:48:19
https://classic.minecraft.net/?join=ZavQnP0kl902n-XQ
2024-06-01 10:07:56
https://s.team/p/jknd-ndcn/bvdnpkcj
2024-06-01 09:22:46
https://s.team/p/gfqp-bppp/NHGRPGTR
2024-05-31 11:23:42
https://www.youtube.com/watch?v=dQw4w9WgXcQ
Don't go there. I warned you...
2024-05-22 08:11:42
Bilguun

https://s.team/p/hwtf-gthv/DQRTHQQB
2024-05-22 08:11:22
https://s.team/p/hhgj-thmv/wcbkmmgd anhlann
2024-05-22 08:09:09
https://s.team/p/jhnh-wcvv/bjrqrcbr
2024-05-20 07:07:17
#include<iostream>
using namespace std;

int main(){
int n;
cin>>n;
int a[100][100];
for(int i = 0 ; i < n ; i++){
for(int j = 0 ; j < n ; j++){
cin >> a[i][j];
}
}
for (int i = 0; i < n; i++) {
int t = a[i][i];
a[i][i] = a[i][n - i - 1];
a[i][n - i - 1] = t;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
return 0;
}
2024-05-20 07:05:35
#include <iostream>

using namespace std;

const int MAX = 300;

int main() {
int m, n, r;
cin >> m >> n >> r;

int matrix[MAX][MAX];
for (int i = 0; i < m; ++i)
for (int j = 0; j < n; ++j)
cin >> matrix[i][j];

int numRings = min(m, n) / 2;

for (int ring = 0; ring < numRings; ++ring) {
int rotations = r % (2 * (m + n - 4 * ring) - 4);

for (int rotation = 0; rotation < rotations; ++rotation) {
int temp = matrix[ring][ring];

// deed talig erguuleh
for (int j = ring; j < n - ring - 1; ++j)
matrix[ring][j] = matrix[ring][j + 1];

// baruun taliig erguuleh
for (int i = ring; i < m - ring - 1; ++i)
matrix[i][n - ring - 1] = matrix[i + 1][n - ring - 1];

// dood taliig erguuleh
for (int j = n - ring - 1; j > ring; --j)
matrix[m - ring - 1][j] = matrix[m - ring - 1][j - 1];

// zuun talig erguuleh
for (int i = m - ring - 1; i > ring; --i)
matrix[i][ring] = matrix[i - 1][ring];

matrix[ring + 1][ring] = temp;
}
}

for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j)
cout << matrix[i][j] << " ";
cout << endl;
}

return 0;
}

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.