Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
nomer9
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
var n,k,a,b,c,d,x,y,m,v,q,w,e,s,p:Real; z:Longint; begin assign(input,'input.txt'); Reset(input); assign(output,'output.txt'); ReWrite(output); Read(a,b,c,d,x,y); if (a<=0) or (b<=0) or (c<=0) or (d<=0) or (x<=0) or (y<=0) then WriteLn(-1) else begin n:=x / (x+y); m:=c / (c+d); k:=a/(a+b); e:=c/(c+d); if (n-m=0) or (k-e =0) or ((k-e>0) and (n-m<0)) or ((k-e<0) and (n-m>0)) then WriteLn(-1) else begin w:=(n-m)/(k-e); s:=w*1000; q:=round(s); z:=trunc(q); WriteLn(z); end; end; end.
Show compiler warnings
[
+
]
Show input
edit mode
|
history
|
discussion