paste bin
Author
Language
Python
Plain text
Accesslog
Action script
Ada
Apache
Arduino
Armasm
Autohotkey
Awk
Bash
Basic
Brainfuck
C
Clojure
Cmake
C++
C#
css
D
Delphi
Dockerfile
Erlang
Fortran
F#
Gauss
Go
Gradle
Graphql
Groovy
Haskell
Ini
Java
JavaScript
json
Julia
Kotlin
Lasso
LaTeX
Leaf
lisp
llvm
Lua
Makefile
Markdown
Mathematica
Matlab
Nginx
Objective-C
Ocaml
Oxygene
Perl
PgSQL
php
Powershell
Processing
Profile
Properties
Puppet
Purebasic
Q
QML
R
Ruby
Rust
Scala
Scheme
Scilab
Shell
Smalltalk
SQL
Swift
Typescript
VB.NET
VB Script
Verilog
Vim
Wasm
x86asm
Xml
Xquery
Yaml
source code:
def gcd(a,b): if a%b ==0 : return b else: return gcd(b,a%b) N=int(input()) while N>0: N-=1 lines=input().split(" ") a=[] for items in lines: a.append(list(map(int,items.split("/")))) num=a[0][0]*a[1][1]*a[2][1] num+=a[0][1]*a[1][0]*a[2][1] num+=a[0][1]*a[1][1]*a[2][0] den=a[0][1]*a[1][1]*a[2][1] d=gcd(num,den) print("{0}/{1}".format(num//d,den//d))
comment: