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.|

RGB7311 - Гуравын зэрэгтэд хураа

Өгөгдсөн тоог 3-ын зэрэгтэд хураа.

Input

Бүхэл тоо өгөгдөнө.

Output

Хураагдсан тоо.

Example

Input:

36

Output:

4


Нэмсэн:Bataa
Огноо:2013-01-11
Хугацааны хязгаарлалт: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
2025-06-05 10:44:44
emulei boliioce
2025-04-30 04:01:49
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>

using namespace std;

// Headers
string toString (double);
int toInt (string);
double toDouble (string);

int main() {
int n;

cin >> n;
while (n % 3 == 0) {
n = (int) ((double) n / 3);
}
cout << n << endl;
return 0;
}

// The following implements type conversion functions.
string toString (double value) { //int also
stringstream temp;
temp << value;
return temp.str();
}

int toInt (string text) {
return atoi(text.c_str());
}

double toDouble (string text) {
return atof(text.c_str());
}
2025-04-30 03:58:51


Last edit: 2025-04-30 03:59:59
2025-01-25 06:29:30
#include<iostream>
using namespace std;
int main ()
{
int a;
cin>>a;
while(a%3==0){
a/=3;
}
cout<<a;
return 0;
}//zzo amjlt
2024-11-28 11:43:23
#include<stdio.h>
int main() {
int ajah;
scanf("%d", &ajah);
while(ajah % 3 == 0&&ajah > 1){
ajah=ajah/3;
}
printf("%d", ajah);

return 0;
} HUULTSGAA ERGUU LALRUUDAA

Last edit: 2024-11-28 11:43:42
2024-11-27 00:00:58
#include <iostream>
using namespace std;

int main() {
int n;
cin >> n;

while (n % 3 == 0) { //
n /= 3; //
}

cout << n << endl;
return 0;
//ryuu bol gci
}
2024-04-15 04:01:33
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>

using namespace std;

// Headers
string toString (double);
int toInt (string);
double toDouble (string);

int main() {
int n;

cin >> n;
while (n % 3 == 0) {
n = (int) ((double) n / 3);
}
cout << n << endl;
return 0;
}

// The following implements type conversion functions.
string toString (double value) { //int also
stringstream temp;
temp << value;
return temp.str();
}

int toInt (string text) {
return atoi(text.c_str());
}

double toDouble (string text) {
return atof(text.c_str());
}
2024-04-15 03:53:26
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>

using namespace std;

// Headers
string toString (double);
int toInt (string);
double toDouble (string);

int main() {
int n;

cin >> n;
while (n % 3 == 0) {
n = (int) ((double) n / 3);
}
cout << n << endl;
return 0;
}

// The following implements type conversion functions.
string toString (double value) { //int also
stringstream temp;
temp << value;
return temp.str();
}

int toInt (string text) {
return atoi(text.c_str());
}

double toDouble (string text) {
return atof(text.c_str());
}
2024-01-14 09:32:32
#include<iostream>
using namespace std;
int main ()
{
int n;
cin>>n;
while(n%3==0 and n>1)
n=n/3;
cout<<n;
}















































































































































































































































































































































































































































































































































































































































































//mai lalaruudaa
2024-01-04 09:38:44
#include<iostream>
using namespace std;
int main ()
{
int n;
cin>>n;
while(n%3==0 and n>1)
n=n/3;
cout<<n;
}
mai muu suguud
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.